How can the priority queue based solution be written using C#?


  • 0
    M

    I find this solution by HelloWorld123456 to be very intuitive.

    https://leetcode.com/discuss/80600/java-easy-version-to-understand

    C# does not have native support for priority queue/heap. How can I write equivalent code that will be accepted by LeetCode? What is an acceptable alternative with O(lgn) insert and remove?


  • 0

    I don't understand why MS doesn't add PQ in the library.....It kills me Every time when I meet PQ questions. Since Java and C++ can easily new a PQ in one line. C# have to start from scratch.....


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.