3 ms·
I'm going to join in and say: you should be able to puzzle out the pseudocode for a BFS, not from "memory", but by thinking about the structure of a tree and as
by efficax 8y ago
I'm going to join in and say: you should be able to puzzle out the pseudocode for a BFS, not from "memory", but by thinking about the structure of a tree and asking yourself what would be required to touch each node at each level before moving on to the next level. It's not fantastically difficult, and if you can figure it out just by reasoning about trees then you're a smart problem solver that I'd like to work with.