search
Log In
0 votes
62 views
Is the array with values $23,17,14; 6,13,10,1,5,7,12$ a max-heap ?
in Algorithms
reshown by
62 views
0
No
Max-heap property is failing at node no. 8

2 Answers

0 votes
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.
0 votes

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

Related questions

1 vote
0 answers
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$
asked Apr 5, 2019 in Algorithms akash.dinkar12 44 views
1 vote
3 answers
2
165 views
Where in a max-heap might the smallest element reside, assuming that all elements are distinct ?
asked Apr 5, 2019 in Algorithms akash.dinkar12 165 views
0 votes
1 answer
3
0 votes
0 answers
4
21 views
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$.
asked Jun 27, 2019 in Algorithms akash.dinkar12 21 views
...