Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
9.2. Heap Structure and Properties
This section
Practice test
11 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
2 cards from this lesson. Good the night before a test.
Try these first
- 1.
What defines a max heap?
Hint
Focus on parent-child relationships.
- 2.
Describe the shape property of a heap.
Hint
Think about how nodes are structured.
- 3.
What is the primary property of a max heap?
- The root is the smallest value
- Every parent is greater than its children
- All levels except the last are filled
Hint
Think about the relationships between parent and child.
- 4.
True or False: A max heap can have gaps between nodes?
- True
- False
Hint
Recall the definition of a complete binary tree.
- 5.
Construct a max heap from the following sequence of integers: 10, 20, 5, 6, 1, 30.
Hint
Remember to 'bubble up' after each insertion as necessary.
- 6.
Design an algorithm to delete the max element in a max heap and illustrate with an example.
Hint
Follow the process closely to maintain the heap.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
4 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
1 more question available
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting