how to use "heapq" module as a max-heap?

2009-03-29 Thread Apollo
as we all known, in the standard module 'heapq',  we can easily get the 
smallest item from the heap. i.e. it's an implementation of min-heap.
  
 my question is how to use 'heapq' to extract the biggest item from the heap?  
is it possible?
  
 thanks  in advance.:)--
http://mail.python.org/mailman/listinfo/python-list


Re: how to use "heapq" module as a max-heap?

2009-03-29 Thread apollo
if the 'heapq' module supports user-defined comparasion, this problem will 
be much easier.


"Apollo"  
??:mailman.2867.1238312539.11746.python-l...@python.org...

as we all known, in the standard module 'heapq',  we can easily get the 
smallest item from the heap. i.e. it's an implementation of min-heap.

my question is how to use 'heapq' to extract the biggest item from the heap? 
is it possible?

thanks  in advance.:) 


--
http://mail.python.org/mailman/listinfo/python-list