Store the array representations of the given 3-ary max-heap after each specified operation into 2d array output, located within the method heapOperations. You'll be storing the array representation at the ith series of operations at row 1-1. Variable output has 12 columns, given that the maximum number of elements under the series of operations is 12. If the array representation after an operation is less than 12, you pad O's at the end. (See Q2 for more details) Note that each operation should be performed on the result of the previous operation. Original 85 71 74 59 65 70 37 26 35 55 Operation 1: After removing the top twice (Store at index 0) 36 Operation 2: After inserting 15 and 100 (Store at index 1) Operation 3: After removing the top once (Store at index 2) Operation 4: After inserting 72 and 88 (Store at index 3) Operation 5: After removing the top 5 times (Store at index 4)
Store the array representations of the given 3-ary max-heap after each specified operation into 2d array output, located within the method heapOperations. You'll be storing the array representation at the ith series of operations at row 1-1. Variable output has 12 columns, given that the maximum number of elements under the series of operations is 12. If the array representation after an operation is less than 12, you pad O's at the end. (See Q2 for more details) Note that each operation should be performed on the result of the previous operation. Original 85 71 74 59 65 70 37 26 35 55 Operation 1: After removing the top twice (Store at index 0) 36 Operation 2: After inserting 15 and 100 (Store at index 1) Operation 3: After removing the top once (Store at index 2) Operation 4: After inserting 72 and 88 (Store at index 3) Operation 5: After removing the top 5 times (Store at index 4)
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps