binary search, DFS, BFS etc. implementation