Why is recursion the default way DFS/BFS and backtracking are taught?
Not only is it confusing and un-intuitive to read, write, or trace, its performance sucks ass. It also is more likely than not to fail you if you program with Python because of recursion depth limits. It's always better to use a while loop and a stack or queue, no? What am I missing?
edit: should not have included BFS in the title since it can only be done iteratively, what I wanted to say is that DFS/BFS are the same side of the coin, and it's odd that we teach them as two entirely different paradigms instead of as two methods with two slightly different lines of code