Question DSA-HEAP-0001
EasyIn a max-heap, where is the largest element?
- A.
At the last position
- B.
Anywhere
- C.
At the root
- D.
At a leaf
Show answer and explanation
Answer: C
Every parent is ≥ its children, so the maximum is at the top.
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
In a max-heap, where is the largest element?
At the last position
Anywhere
At the root
At a leaf
Answer: C
Every parent is ≥ its children, so the maximum is at the top.