Python implementations for binary search, DFS, BFS