Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercises 1-5 for recursion tracing #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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

- 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.

- 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.

@@ -40,8 +61,16 @@ end
```

- 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