Question

1. Which of the following is a proper array representation a binary min heap?


1. Which of the following is a proper array representation a binary min heap?

image.png

2. 

A heap is implemented using an array. At what index will the right child of node at index i be found? 

Note, the Oth position of the array is not used.

Select one:

a. i/2

b. 2 i+1

c. i-1

d. 2 i


3. 

Consider the following array of length 6. Elements from the array are added, in the given order, to a max heap. The heap is initially empty and stored as an array.

A={18,5,37,44,27,53}

What will be parent of 27 in the heap _______ :

4. 

Consider you have the following max heap tree-

image.png

what will be parent of 34 after we insert 49 in the heap

5.

Consider the the following array of length 6. Elements from the array are added, in the given order, to a min heap. The heap is initially empty and stored as an array.

A={53,17,9,45,39,28}

What will be parent of 45 in the heap: _______ 


8 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1

1) Answer: Option b)

The Min Heap Tree after insertion of all array values as follows:

Explanation:

1 15 1186

3) Parent of 27 in the max Heap is 37

Explanation: Max Heap Tree based on array values is as follows

4) Parent of 34 is after inserting 49 is 54

Explanation:

5) Parent of 45 in the Heap is 39

Explanation:

Add a comment
Know the answer?
Add Answer to:
1. Which of the following is a proper array representation a binary min heap?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT