DFS is faster than BFS in finding a match