Thursday, September 12, 2013

Heap implementations in the java standard library

TreeSet or PriorityQueue may be used to represent heap data structure.
TreeSet doesn't allow duplicates, while PriorityQueue does. 
However PriorityQueue doesn't allow iteration without removal which makes
some applications difficult, e.g. for implementing Prim's minimum spanning
tree algorithm for graphs.

No comments: