For those who've looked at my SLOG before and found it blank, I'm sorry: I've started a lot of drafts (or just kicked an idea around in my head), but never actually finished or fully posted any yet, so all of these are going to look back-to-back.
-----------------------------------------------------------------------------------------------------------
![]() |
| Yes, Google, I did mean...wait a second. |
Whenever recursion gets applied to computer science, usually one of three things happen:
- Bad jokes abound.
- The answer seems simple. "So the only cases are...okay, that makes sense."
- The question may as well have been written in Wingdings. "So it has to either...but it can't...what?"
When it's things like the total sum of a nested list, life is great. But when you get to cases with unusual objects, or multiple cases, it's difficult to even start: you have to figure out what variables the function will take, and how the function will return those values to another iteration of itself for more processing, and eventually you realize you just pulled your hair out in clumps and will probably need a wig. Also, that you've still failed to write anything down.
One thing I've noticed is that I have a bad habit to try and figure out how the internal bits of the function work: from what I've seen, it's far better to consider what the possibilities are for it to continue recursing or to be an end case and be able to start returning things. Regardless, I'm still going to need a lot more work at it: this is definitely not something that comes naturally at all.

No comments:
Post a Comment