Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What happens if you try to insert a duplicate value in a binary search tree?
Think about maintaining unique values in the structure.
What direction do you take when inserting a value smaller than the current node?
Smaller values go to the left!
What will happen if you try to insert a value that already exists in a binary search tree?
Remember the uniqueness requirement!
True or False: A binary search tree must always contain at least one node.
Consider what the minimum structure of a tree is.
Construct a binary search tree by inserting the values [15, 10, 20, 8, 12, 17, 25]. Draw the tree structure and explain each step.
Keep track of where each value goes!
You have a binary search tree and want to insert 25 after inserting 15, 10, and 20. Describe the traversal steps taken and the reasoning.
Think about how each comparison determines the next path in the tree.
4 more questions in this section. Enroll free to practise them all.
Enroll free