'''
heapify() - 최소힙을 만들어준다.
import heapq
li = [5, 7, 9, 1, 3]
heapq.heapify(li) # [1, 3, 9, 7, 5]
'''
heapify() 그림으로 보기
li = [5, 7, 9, 1, 3] # len(li)= 5이다. 5의 반읜, 2.5, 올리지않으면 2. 즉, index부터 시작한다.
트리는 인덱스가 1부터 시작
step1
5 (1)
7 (2) 9 (3)
1(4) 3(5)
step2
5 (1)
1(2) 9 (3)
7(4) 3(5)
출처:
https://www.geeksforgeeks.org/heap-data-structure/
https://ratsgo.github.io/data%20structure&algorithm/2017/09/27/heapsort/