Answered step by step
Verified Expert Solution
Question
1 Approved Answer
let max heap h be the heap that the root of heap is the maximum value. h is divided into h[a / 2] from the
let max heap h be the heap that the root of heap is the maximum value. h is divided into h[a / 2] from the first half and h[n/2+ 1] until h[n] of the second half, the first half is stored in array A, and the second half is stored in array B
date of listing, each of the following x On the other hand,
circle the correct one:
1 array A is a heap
yes because 1- n/2 is parent of leaf
2. array B is a heap
no because n/2+1 until n is leaf
3. if n data already stored in heap h. An array that is formed by inserting a value larger than all the value in heap at the beginning/head of the heap h is assumed to be new array C .
The array C is a heap (or) not ?
4 if n data already stored in heap h. A new array D that is created by adding a value u to the heap h that is smaller than any of the n data already stored in heap . if u is added to last element in heap , is Array D heap or not?
please explain number 3,4 thanks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started