A binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child.
Applications of Binary Tree
- Decision Trees (true / false)
- Database Indicies
- Sorting Algorithms
How Does A Binary Search Tree work
- Every parent node has at most two children
- Every node to the left of a parent node is always less than the parent
- Every node to the right of a parent node is always greater than the parent
Big O of BST
- Insertion – O(log n)
- Searching – O(log n)
RECAP
- Binary Trees can have values of any type, but at most two children for each parent
- Binary Search Trees are a more specific version of binary trees where every node to the left of a parent is less than it’s value and every node to the right is greater
Written by Okocha Ebube