Amazon Interview Question

Tree level order traversal and Top k frequency.