BFS vs DFS Qs

Run Settings
LanguageJavaScript
Language Version
Run Command
//If you know a solution is not far from the root of the tree: //BFS //If the tree is very deep and solutions are rare: //BFS ( DFS can take long? ) (will revisit this one) //If the tree is very wide: //BFS, but if memory is an issue, DFS (will revisit this one) //If solutions are frequent but located deep in the tree: //DFS //Determining whether a path exists between two nodes: //DFS //Finding the shortest path: //BFS
Editor Settings
Theme
Key bindings
Full width
Lines