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.3. Examples of Heaps
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
3 cards from this lesson. Good the night before a test.
Try these first
- 1.
What is a heap?
Hint
Think about its purpose in managing priorities.
- 2.
What makes a max heap?
Hint
Recall the definition of a max heap.
- 3.
What operation retrieves the maximum element from a heap?
- Insert
- Delete Max
- Get Min
Hint
Think about which operation deals with the priority.
- 4.
Is it true that any binary tree is a heap?
- True
- False
Hint
Remember the properties of a heap.
- 5.
Design a heap from the numbers [15, 10, 2, 1, 8, 5]. Describe the steps you take to build it.
Hint
Be cautious about rearranging numbers as you insert.
- 6.
If you have a valid heap and remove the max element. What must happen next? Create a list of steps showing the process.
Hint
Visualize how the last element fills the void.
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