ELI5: Binary Search Trees 🌲. Let’s talk about algorithms. Specifically, the binary search tree algorithm. In this post, I’m going to explain (like you’re 5 years old). What is a Binary Search Tree? The tree is made up of things called nodes. The ELI5 Algorithms Series.
Let’s talk about algorithms. Specifically, the binary search tree algorithm. In this post, I’m going to explain (like you’re 5 years old) what a binary search tree is, how to implement it, and when we use it. Ready? Let’s go!
A binary search tree is an ordered tree data structure. It’s a convenient way to sort some data according to a set of “greater than/less than” rules.
The tree is made up of things called nodes. Whenever you add new data to your tree, it begins its sorting journey starting from the root node and going down the tree from there until it finds an empty position to insert itself at. More on those technical terms soon.
New nodes finding a home in our binary search tree
This tricky Kadane’s Algorithm with a deceptively simple solution is a great introduction to more optimal problem-solving practices. Continue ...