BFS, DFS, hill climbing, C++