CF binary search tree in js