Question: Propose an algorithm and write python code (iterative and NOT recursive) that checks if a given array is a max-heap or not. User enters an
Propose an algorithm and write python code (iterative and NOT recursive) that checks if a given array is a max-heap or not. User enters an array and heap size and your program returns either True or False. The input to the program will be given as shown below with the elements of the array separated by a space. Clearly mention any assumptions as a comment in your program. Sample Run of the program: Enter the array to test: 16 14 10 8 7 9 3 2 4 1 0 20 Enter heap size: 10 True
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
