Binary Search Tree (BST)

Ordered binary tree where Left < Root <= Right.

Status: Tree is empty.
Speed

Algorithm Logic

1function insert(root, val):
2 if !root: return new Node(val)
3 if val < root.val:
4 root.left = insert(root.left, val)
5 else:
6 root.right = insert(root.right, val)
7 return root