[Solved]8 6 Points Oscar Gets Bright Idea Adding Arbitrary Removeelementatindex Int Array Based Ma Q37174543

8. 6 points Oscar gets the bright idea of adding an arbitrary removeElementAtIndex(int i) to his array based mar heap implementation. His implementation does the following: it removes the i th element and replaces it with the last clement (the element at the lowest level all the way to the right). To fix the heap so that the heap property is preserved, he then bubbles it down the heap, swapping it with any elements that are greater than it. Unfortunately, this solution will not work. Provide an example heap configuration and such a remove operation for which it would fail. 20 20 10 30 30 10 (35 35 25 25 15 (a) Binary Search Tree (b) Inverted Binary Search Tree Higure 2: Binary search tree and its inversion Show transcribed image text 8. 6 points Oscar gets the bright idea of adding an arbitrary removeElementAtIndex(int i) to his array based mar heap implementation. His implementation does the following: it removes the i th element and replaces it with the last clement (the element at the lowest level all the way to the right). To fix the heap so that the heap property is preserved, he then bubbles it down the heap, swapping it with any elements that are greater than it. Unfortunately, this solution will not work. Provide an example heap configuration and such a remove operation for which it would fail.
20 20 10 30 30 10 (35 35 25 25 15 (a) Binary Search Tree (b) Inverted Binary Search Tree Higure 2: Binary search tree and its inversion
Expert Answer
Answer to 8. 6 points Oscar gets the bright idea of adding an arbitrary removeElementAtIndex(int i) to his array based mar heap im… . . .
OR

