What if you could find the smallest item instantly without checking every single one?
Why BST Find Minimum Element in DSA Go?
Imagine you have a messy pile of books on your desk, and you want to find the book with the smallest page number. You start picking up each book one by one, checking the page number, and remembering the smallest so far. This takes a lot of time and effort.
Manually checking each book is slow and tiring. You might forget which book had the smallest page number or miss some books. This makes finding the smallest item error-prone and frustrating.
A Binary Search Tree (BST) organizes books so that smaller page numbers are always to the left. To find the smallest book, you just keep going left until you can't go further. This is quick and simple, saving time and effort.
minPage := books[0] for _, book := range books { if book.page < minPage.page { minPage = book } }
current := root
for current.Left != nil {
current = current.Left
}
minPage := currentThis lets you quickly find the smallest item in a sorted structure without checking everything.
When a library system wants to find the oldest book (smallest ID) quickly, it uses a BST to jump straight to it without scanning all books.
Manual search is slow and error-prone.
BST structure keeps smaller items to the left.
Finding minimum means going left until no more left child.