Amazon interview question

Top k frequent words Preorder using stack in tree

Interview Answer

Anonymous

4 Nov 2023

Told them the correct solution in the first one. And in 2nd one told them the solution using recursion, tried solving it with stack ,was very close to the correct one but was able to give the idea what i was thinking.