fromminheapimportminheapdefheapsort(a):"""heapsort algorithm using minheap as an auxiliary data structure """h=minheap(len(a))forxina:h.insert(x)foriinrange(len(a)):a[i]=h.get_min()h.remove_min()
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.