Question: Consider the following pseudocode. 1 is Heap ( Array , start , end ) 2 3 if start >= end 4 return true 5 else

Consider the following pseudocode. 1 is Heap ( Array , start , end ) 2 3 if start >= end 4 return true 5 else 6 return Array ( start) > Array (2* start) AND Array (start) > Array (2* start+1) AND is Heap (Array,2* start , end) AND is Heap (Array , 2* start +1,end) Will this algorithm correctly identify an array that is a heap? If so, how many elements will need to be checked? If not, how may the algorithm be changed so that it is correct
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
