Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void insert(int value) { // complete this function
- heapArray.insertAtEnd(value);
- int currNode = getSize();
- System.out.println(heapArray.length);
- System.out.println(heapArray.access(currNode));
- while(currNode > 0 && heapArray.access(getParentIndex(currNode)) > heapArray.access(currNode)) {
- swap(heapArray.access(getParentIndex(currNode)),heapArray.access(currNode));
- currNode = getParentIndex(currNode);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement