We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Data Structures
- Heap
- QHEAP1
- Discussions
QHEAP1
QHEAP1
Sort by
recency
|
409 Discussions
|
Please Login in order to post a comment
Why this is getting TLE, where as if I create a heap class and acces custom-made delete method which is actually self.heap.remove(element) is ok??
Python 3
C# Solution :
C++ (more at https://github.com/IhorVodko/Hackerrank_solutions , feel free to give a star :) )
Here is a C# solution, internally using the PriorityQueue class. Note it can work even when we have duplicate values in the heap: