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.
1.7. Binary Search Trees
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
3 cards from this lesson. Good the night before a test.
Try these first
- 1.
What property differentiates the left and right children of a node in a binary search tree?
Hint
Think about how values are organized in a BST.
- 2.
In a BST, if the root is 10, and there is a left child of 5, what value could the right child hold?
Hint
It's about the relationship between parent and child nodes.
- 3.
What is the time complexity of searching for an element in a balanced binary search tree?
- O(n)
- O(log n)
- O(n log n)
Hint
Consider how many comparisons you might need at each level.
- 4.
True or False: A binary search tree can contain duplicate values.
- True
- False
Hint
Think about the fundamental definition of a BST.
- 5.
Construct a binary search tree from the following list of values: 20, 10, 30, 5, 15, 25, 35. Then, perform an in-order traversal.
Hint
Keep the BST properties in mind while inserting values and remember the traversal order.
- 6.
Provide an algorithm to delete a node with a specified value from the binary search tree and explain the steps involved.
Hint
Think about how the tree structure changes after a deletion.
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