130. Heapify
Given an integer array, heapify it into a min-heap array.
For a heap array A, A[0] is the root of heap, and for each A[i], A[i 2 + 1] is the left child of A[i] and A[i 2 + 2] is the right child of A[i].
复习堆的时候把这个题目当练习做了,这实际上是构造一个最小堆
|
|
Given an integer array, heapify it into a min-heap array.
For a heap array A, A[0] is the root of heap, and for each A[i], A[i 2 + 1] is the left child of A[i] and A[i 2 + 2] is the right child of A[i].
复习堆的时候把这个题目当练习做了,这实际上是构造一个最小堆
|
|