Quick actions

cmd+k|ctrl+k

Navigation

Languages

Linear Search

Snippet info

Language

Dart

Visibility

public

Author

obihenry578

Created

2025-02-26T10:57:44.428769Z

Updated

2025-02-26T10:57:44.428769Z

void main() {
 //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 takes lesser time because dfs might take longer time


//If the tree is very wide:   dfs because bfs will need more memory

//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
}
INFO