Skip to content

Conversation

@birbalds
Copy link

@birbalds birbalds commented Apr 3, 2017

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? no

- Infinite Recursion/Stack Overflow/Stack too deep
- Tail Recursion
- Recursion - **The use of a method/application inside itself**
- Recursive Case - **A problem that is divided into smaller problems**

Choose a reason for hiding this comment

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

This is not correct.

A recursive case is the case in which the method actually calls itself.

- Tail Recursion
- Recursion - **The use of a method/application inside itself**
- Recursive Case - **A problem that is divided into smaller problems**
- Base Case - **An immediately solvable problem**

Choose a reason for hiding this comment

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

i.e. Where the method knows the answer without recursing.

- Base Case - **An immediately solvable problem**
- Activation Chain/Stack - **All of the iterations of the method being called within itself**
- Activation Record/Call - **A single instance/iteration point of the method being called within itself**
- Infinite Recursion/Stack Overflow/Stack too deep - **An error that occurs when the method results in an infinite loop**

Choose a reason for hiding this comment

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

I wouldn't say "error". It's a situation where the method results in an excessive use of memory that is usually caused by an infinite loop of sorts with many many calls to the recursive method.

- What is mystery5("")?
- What is mystery5("Hi, there!")?
- What is mystery5("hi")? **
- What is mystery5("")? **blank**

Choose a reason for hiding this comment

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

You should always put things that return a String in double quotes. For this answer, the answer should be "" (empty String) but saying "blank" is confusing.

- What is mystery6("Hi, there!")?
- What is mystery6("goodnight moon")? **moon goodnight**
- What is mystery6("Ada Developers Academy")?**Academy Developers Ada**
- What is mystery6("Hi, there **there! Hi,**

Choose a reason for hiding this comment

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

Minor, but notable: there should be a leading space on each of these " moon goodnight", " Academy Developers Ada", " there! Hi,"

@sudocrystal
Copy link

Recursion Tracing

A little feedback, but 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