Question DSA-HEAP-0006
EasyIs a binary heap a complete binary tree?
- A.
Yes
- B.
Only when it has an odd number of nodes
- C.
Show answer and explanation
Answer: A
Completeness lets the heap be stored in an array with no gaps.
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
Is a binary heap a complete binary tree?
Yes
Only when it has an odd number of nodes
Answer: A
Completeness lets the heap be stored in an array with no gaps.
No
Only a max-heap