3 ms·Yeah BFS/DFS are O(n) for graphs and trees.by glass_of_water 13y agoYeah BFS/DFS are O(n) for graphs and trees.