Depth-first as per the JS book
Topo sort, but not working
Implemented function to check if a tree is a BST