Back to course home
0% completed
Vote For New Content
For using a max-heap vs. a min-heap, which solution in this case would an interv...
Richard Yuan
Aug 8, 2022
For using a max-heap vs. a min-heap, which solution in this case would an interviewer be looking for as the most optimal? It is hard to tell from the current time complexities listed which approach is fastest. Usually, we are taught that we would use the max-heap when we are looking for the Kth smallest number, but I understand that a min-heap could also be utilized to achieve the same goal.
0
0
Comments
Comments
Design Gurus3 years ago
Max-heap solution could be considered a bit better, especially with the space complexity.
Given that we have a better solution available without using a min or max heap, these solutions were listed only to develop the learning of different algorithmic techniques.
On this page