public class Solution { /** * @param A: Given an integer array * @return: void */ public void heapify(int[] A) { // write your code here //push pop top if (A.length == 0 && A == null) { return; } int l = A.length; for(int i = 0; i < l; i++) { push(A, i); } } public void push(int[] A, int index) { while(index != 0) { if(A[(index - 1 ) / 2] > A[index]) { int temp = A[(index - 1 ) / 2]; A[(index - 1 ) / 2] = A[index]; A[index] = temp; } index =(index - 1) / 2; } } /* public void pop(int a) { } public int top(int a) { } */ }