Loading [Contrib]/a11y/accessibility-menu.js
Back
Close

Heap Sort example.

shubhmsng
2,799 views

Welcome!

Heap sort.

def heapify(a, i, heap_size):
l = 2*i
r = 2*i + 1
if l < heap_size and a[l] > a[i] :
largest = l
else:
largest = i
if r < heap_size and a[r] > a[largest]:
largest = r
if largest != i:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants