JavaScript implementation for Binary Search Tree