Question DSA-HEAP-0017
HardA max-heap is stored as [50, 30, 40, 10, 20, 35]. After inserting 45, what is the array?
- A.
[50, 45, 40, 10, 20, 35, 30]
- B.
[50, 30, 45, 10, 20, 35, 40]
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Heaps and Priority Queues question
A max-heap is stored as [50, 30, 40, 10, 20, 35]. After inserting 45, what is the array?
[50, 45, 40, 10, 20, 35, 30]
[50, 30, 45, 10, 20, 35, 40]
Sign up free to see the answer and a step-by-step explanation.
[45, 50, 40, 10, 20, 35, 30]
[50, 30, 40, 10, 20, 35, 45]