Interviewing in Javascript. (How to handle data strucutures like Heaps)?
Anonymous User
2758

If I want to use Javascript to interview with for coding questions. What do you do in the case where the optimal space and time complexity would require you to use a heap (PQ/min-max heap)? Do you have to write out the data structure for a heap before approaching the question?

Currently, if I want to find the kth highest number. I would have an array and push top values in descending order and find it that way.

Ex. https://leetcode.com/problems/top-k-frequent-words/

Comments (3)