I want to use heaps to solve leetcode questions how can I import binary heap data structure without implementing it from scratch.
BinaryHeap<int> heap = new BinaryHeap<int>();
something like this.
I want to use heaps to solve leetcode questions how can I import binary heap data structure without implementing it from scratch.
BinaryHeap<int> heap = new BinaryHeap<int>();
something like this.
You can try SortedSet in C# which is to some extent same as BinaryMinHeap
Based on the problem you are trying to solve , you can check if SortedSet works for you.
SortedSet<int> heap = new SortedSet<int>();