ByteDance interview question

DFS BFS recursion matrix stack