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.
15.1. Finding the Minimum
This section
Practice test
12 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
4 cards from this lesson. Good the night before a test.
Try these first
- 1.
What is the minimum value in the tree that looks like this: 10 ↘ 5 ↘ 20?
Hint
Look for the leftmost node.
- 2.
True or False: The maximum value of a BST can be found at a left child.
Hint
Think about how the values are organized in the tree.
- 3.
What is the primary method for finding the minimum value in a BST?
- Go right
- Go left
- Go up
Hint
Think about which direction you travel for smaller values.
- 4.
True or False: In a BST, the predecessor of a node will always be its left child.
- True
- False
Hint
Consider how to find the predecessor in the absence of a left child.
- 5.
Given a BST with the following structure, find the predecessor and successor of the node with value 7.
- python5 / \ 3 8 / \ \ 1 4 9 \ 6Show the path taken.
Hint
Think about moving up the tree and checking right/left children.
- 6.
Write an algorithm to remove a node from a BST and then find the minimum and maximum values afterwards. Describe each step clearly.
Hint
Consider if the node has children and how that impacts the structure.
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
2 more questions 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