Skip to content

Conversation

@habypsow
Copy link

Recursion Tracing

Thanks for doing some brain yoga. You are now submitting this assignment!

Comprehension Questions

Question Answer
Did you define all the recursion terms? yes
How do you feel about tracing recursive problems? (good, bad, ugly, neutral) good
Would you like help/follow up about recursion? it would be nice to revisit this in class if time allows

- Recursion
Recursion : See recursion
- Recursive Case
A problem that can be divided into smaller problems

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... this is true. But not the definition of recursion. Recursion is specifically when a method calls itself, directly or indirectly.

Never ending recursion, too much memory/resources being used up to solve this never ending recursion
- Tail Recursion

the return value of any given recursive step is the same as the return value of the next recursive call

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great answer! We didn't cover it in class though - so good googling :) I wonder though, does the answer make sense to you? I've been debating covering this in class - just not sure if there's time.

- What is mystery2(123)?
mystery2(123) = (3) + mystery2(12) = 5
m2(12) = 1 + m2(1) = 2
m2(1) = 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) The logic is correct. but m2(12) should be 2 + m2(1) which changes the rest of the recursion math.

- _Added Fun: How could we make only alphabetic characters to be changed to stars?_

### Trace #6
### Trace #6 #Will come back to this one =)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or not... which is totally fine too :) 5/6 were just added challenges.

@sudocrystal
Copy link

Recursion Tracing

Looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants