Google Screening Interview - L5
Anonymous User
1362

Recently I had a interview with google for screening round. Huffman decoding question asked. I feel it is bit tough for screening round.
Question - you are given input as {'a':2, 'd':1, 'e':2} and output ->
return below tree:
*
/
d *
/ \
a e
here a and e is the child of * not d (not able to draw it here)
Note -> here d : 1 (char and bit length), bit length denotes level,
if level is same then small char should come first(left to right)
I have tried to code it but not able to finish it. Any thoughts on the problem.

one more thing - letter are only at leaf node.
ex:
d = 0
a = 10
e = 11
here 0 means go left, 1 means go right

Comments (7)