The next part of my Data Structures series is binary search trees.

A Binary Tree is a data structure where each node can have 0, 1 or 2 nodes. Each child can only have 1 parent.

The benefits of using a binary search tree are the look up times are better than O(n), the tree is ordered and the size is flexible. Trees are useful because you can find data going into a subset of the data instead of searching through every element in the tree. A balanced binary search tree look up times are O(log(n)) for access, search, insert and delete. An…