Hacker News new | ask | show | jobs
by shinepl10 2711 days ago
If I had to resolve BFS problem I wouldn't bitch about it like this guy, because the only thing you need to know is how to move across the tree. The rest - you can come up with that - it's not that hard and it's showing your thinking process.
1 comments

Yeah, precisely. BFS and DFS are part of a very small collection of algorithmic questions I consider fair game — but I would never ask them directly. Instead I'm likelier to ask something like pretty printing a directory structure, so a function that prints out something like

    bin/
      sh
    usr/
      bin/
      local/
        bin/
      var/
      ...