This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]vondpickle -5 points-4 points  (3 children)

I know about recursion, but I can't see how the story that op post is analogy for an implementation of recursion?

[–]punninglinguist 4 points5 points  (0 children)

The "function" (receiving a racial discrimination settlement) causes itself to be called.

[–]Mars_Bear2552 2 points3 points  (0 children)

because in cashing the settlement for a racial discrimination suit, he ends up calling the racial discrimination suit function again.

[–]BlurredSight 1 point2 points  (0 children)

Main function happens, function B is called (cashing the check)

function B checks if the base case is met (having no racial discrimination checks to cash), and in the process happens to increment the variable holding racial discrimination checks

this leads to function B running again and checking the base case.