DSA in Python · Lesson 75 of 132
Trees Quiz
Test yourself.
Trees, binary search trees, heaps, and tries. That's a lot of branching. Let's check it. Pause, answer, then listen.

- Trees, BSTs, heaps, tries
- Let's check
- Pause and answer
Question 1
Which traversal of a binary search tree gives the values in sorted order? The answer is in order. Left, then the node, then right.
Quick check
Sorted output from a BST?
Question 2
What does a binary search tree become if you insert values that are already sorted? The answer is a chain, like a linked list, with O of N searches.
Quick check
Insert sorted values into a plain BST, and you get…
Question 3
Where is the smallest item in a min heap? The answer is at the top, which is index zero in Python's heap Q.
Quick check
In heapq, the smallest item is at…
Question 4
Which structure is best for autocomplete? The answer is a trie, because words with the same beginning share a path.
Quick check
Best for autocomplete?
Summary
Brilliant. Next, a new section. Graphs, the structure behind maps, networks, and social media.
Key takeaways- In order = sorted
- Sorted input → chain
- heap[0] is the smallest
Next up: Graphs — nodes and edges