Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

max heap python

import heapq

Since the built in heapq library is a minheap, multiply your values by -1
and it will function as a max heap. Just remeber that all your numbers 
have been inverted.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #max #heap #python
ADD COMMENT
Topic
Name
8+8 =