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