Heap Sort example.
def heapify(a, i, heap_size):
l = 2*i
r = 2*i + 1
if l < heap_size and a[l] > a[i] :
largest = l
largest = i
if r < heap_size and a[r] > a[largest]:
largest = r
if largest != i:
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
Create a Server using Python and Pyramid
Why Learn Python
How to build a chatbot in less than 50 lines of code
Star Rocket Python Program test
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Show / hide this help menu