binary search tree, shortest path and connected graph