1.) Suppose a document contains 22 A, 12 B, 24 C, 6 D, 27 E, 9 F. Determine the best manner to encode each character with the least number of bits by a greedy approach.
2.) Give a greedy algorithm for partitioning a set of n weights into k bins. Does it find the perfect solution?