about | help | code help+videos | done | prefs |
addToMaxHeap
Given an array of positive integers that represents a max heap, (except for the first value which is always empty, and the last value which represents a node where we will put a new value), add the given value to the heap using the technique shown in class and in your textbook. Do not create a new array. Just modify and return the given array. addToMaxHeap([0, 12, 7, 5, 0], 8) → [0, 12, 8, 5, 7] addToMaxHeap([0, 10, 6, 10, 0], 99) → [0, 99, 10, 10, 6] addToMaxHeap([0, 99, 10, 10, 6, 0], 12) → [0, 99, 12, 10, 6, 10] ...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: 100
Copyright Nick Parlante 2017 - privacy