Is there a binary heap implementation where I can pop other elements than the root in log n time?
I use heapq - but heap.index( wKeys )
in
heap.pop( heap.index( wKeys ) )
is very slow. I need a binary heap for my problem - where I sometime use
heapq.heappop(heap)
but also need to pop other elements than at the top from the heap. So a binary heap like heapq imlementation should do that but I havnt found a binary search method. I also looked at treap (http://stromberg.dnsalias.org/~strombrg/treap/) and cannot find a method like this here either.