about | help | code help+videos | done | prefs |
Given an array of positive integers that represents a max heap, show the array after removing the largest element and fixing the heap (using the same algorithm from class and from your textbook). Set the final element in the array to 0 to indicate that it is empty. Do not create a new array. Just modify and return the given array. When moving a node downward, if both children have the same value, choose the child on the left. removeMaxFromHeap([0, 7]) → [0, 0] removeMaxFromHeap([0, 12, 5]) → [0, 5, 0] removeMaxFromHeap([0, 12, 5, 7]) → [0, 7, 5, 0] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy