Thursday, October 16, 2008

The Golden Rules of Recursion

1) never iterate
2) always follow the first rule ;-)

4 comments:

Anonymous said...

I propose a coding standard:

"The Coding Standard"
1. Avoid recursion
2. Examine your code against "The Coding Standard"

Travis Whitton said...

fatal error: stack overflow.

Ray Forrester said...

how do you do tree traversal without recursion? I feel stupid.

Unknown said...

@ray forrester
Just take a tree traversal and write the logic out for yourself in pseudocode. It's not actually that hard.

To know recursion, you must first know recursion.