News for hackers. Stuff that matters.
Re:Solving dynamic programming interview problems by ghettoimp on Saturday May 19, 2018 @08:31AM (#17107630)
Very much agree.

If you are working on any kind of tree structure, graph, parse tree, etc., recursion can be really beautiful and clear.

My theory: folks like iteration because 90% of the "for" loops they write are really just "foreach".

Re:Solving dynamic programming interview problems by bogomipz on Saturday May 19, 2018 @09:08AM (#17107741)
>"folks like iteration because 90% of the "for" loops they write are really just "foreach"."

I didn't understand this comment. What do you mean by "for vs foreach."? Can you elaborate?

Re:Solving dynamic programming interview problems by bkdonline on Sunday May 20, 2018 @02:21AM (#17111494)
I guess the foreach is where each iteration has independent operation, vs a generic for loop where this iteration depends on result of the previous iterations.