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.12. Searching in 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 defines a binary search tree?
Hint
Think about how the values are arranged in a BST.
- 2.
Describe in-order traversal in a BST.
Hint
Consider the sequence of visiting nodes.
- 3.
What is the time complexity of searching in a balanced binary search tree?
- O(n)
- O(log n)
- O(1)
Hint
Consider how binary search works in reducing the search space.
- 4.
True or False: In a binary search tree, all values in the left subtree are greater than the node's value.
- True
- False
Hint
Remember the defining property of a BST.
- 5.
You have a series of values to insert into a binary search tree: 10, 20, 5, 3, 7, 15. Construct the tree and perform in-order traversal.
Hint
Visualize inserting in sequential order while following the BST property.
- 6.
Given a binary search tree with values (5, 3, 8, 1, 4, 7, 9), if you were to delete the node with value 3, how would you proceed, and what would the new in-order traversal be?
Hint
Understand that deleting a node involves maintaining the BST properties.
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