Introduction
Imagine you have a phone book organized by last names. If the names are not evenly spread out, finding a name can take a long time. This problem happens in binary search trees when they become unbalanced, making searches slow.
Imagine a library where books are arranged on shelves. If all books are stacked on one shelf, finding a book takes longer. But if books are spread evenly across shelves, you can find any book quickly by going to the right shelf.
Balanced BST:
8
/ \
4 12
/ \ / \
2 6 10 14
Unbalanced BST:
2
\
4
\
6
\
8
\
10
\
12