# Cormen Edition 3 Exercise 6.1 Question 6 (Page No. 154)

62 views
Is the array with values $23,17,14; 6,13,10,1,5,7,12$ a max-heap ?

reshown
0
No
Max-heap property is failing at node no. 8

no,  max heap is not possible bcoz it is failing the property at node 8 insertion time.  but if we are implementing it by array then there is basic fault in question bcoz in array data type should be similar here .6 is given which is float type.

The Node with Value $6$ and $7$ violates the $Max-HEAP$ $Property$, according to which the $Parent[key] >= Child[key]$

## Related questions

1 vote
1
44 views
Show that, with the array representation for storing an $n$-element heap, the leaves are the nodes indexed by $\lfloor n/2\rfloor +1$,$\lfloor n/2\rfloor +2,…,n$
1 vote
HEAP-EXTRACT-MAX(A) 1 if A.heap-size < 1 2 error “heap underflow” 3 max=A[1] 4 A[1]=A[A.heapsize] 5 A.heapsize=A.heapsize-1 6 MAX-HEAPIFY(A,1) 7 return max Illustrate the operation of HEAP-EXTRACT-MAX on the heap $A=\langle 15,13,9,5,12,8,7,4,0,6,2,1 \rangle$.