-
Notifications
You must be signed in to change notification settings - Fork 32
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
base: master
Are you sure you want to change the base?
Conversation
- 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Recursion TracingI 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? |
Recursion Tracing
Thanks for doing some brain yoga. You are now submitting this assignment!
Comprehension Questions