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

Allison Northrop - Queues #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Allison-Northrop
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? I defined all of them except Activation Record/Call. Though I defined the others I'm still a bit hazy on some of the concepts.
How do you feel about tracing recursive problems? (good, bad, ugly, neutral) When I did it in class I understood it (though I was slow to figure out the problems) but after a few days I forget what I was doing exactly.
Would you like help/follow up about recursion? I think some extra practice/more tutorials would be really helpful! When I have time I'm going to go back and answer more of the recursion problems to get more practice. I'd also love more examples of when recursion is used in the "real" programming world.

- Base Case
- Activation Chain/Stack
- Recursion: Recursion is when you have a method that calls itself. All recursive methods can be written iteratively.
- Recursive Case: The initial case where there isn't a known number.

Choose a reason for hiding this comment

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

Hmm... this doesn't make sense to me.

I'd say the recursive case is the case in which the method calls itself.

- Activation Chain/Stack
- Recursion: Recursion is when you have a method that calls itself. All recursive methods can be written iteratively.
- Recursive Case: The initial case where there isn't a known number.
- Base Case: When you finally get to the point where you can input a known number and "work backwards" to get the answer to a recursive problem.

Choose a reason for hiding this comment

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

This is true.

You could also say a base case is the case which stops the recursion by not calling the method again.

- Recursion: Recursion is when you have a method that calls itself. All recursive methods can be written iteratively.
- Recursive Case: The initial case where there isn't a known number.
- Base Case: When you finally get to the point where you can input a known number and "work backwards" to get the answer to a recursive problem.
- Activation Chain/Stack: The process in which recursion occurs
- Activation Record/Call

Choose a reason for hiding this comment

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

This is one specific call to the recursive method.

@@ -24,7 +24,7 @@ def mystery1(n)
end
```

- What is mystery1(5)?
- What is mystery1(5)? did problems below

Choose a reason for hiding this comment

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

I don't know what this means? I don't see any answers.

- What is mystery2(-123)?
- What is mystery2(123)? 6
- What is mystery2(9005)? 14
- What is mystery2(-123)? -123

Choose a reason for hiding this comment

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

These three are correct but are the only answers that I see in this document.

@sudocrystal
Copy link

Recursion Tracing

I don't see the answers to most of the tracing problems. If you'd like to sit down and walk through a problem or two, I'm happy to do that - just slack me. Or perhaps the answers to the rest just weren't pushed up or something?

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