What is recursion in Java?

As one of the hardest part in what I have learned in Java, recursion cost me a lot of time to learn, to understand and to master it. Here is my plan for this page. I will try to explain what recursion is and what it means to programmers with the first three sources below. And bring some simple questions with the last two to form a bigger picture of how recursion going to be used in this programing language.

Introduction of recursion:

Recursion in Java means solves a problem by dividing it to similar smaller problems recursively. And Freelaunch is an important concept to understand for recursion. Basically, a recursive method will run into the smaller instance by freelaunch the method itself instead of finish running through all the code in the first place.

Sources:

1.

http://web.cse.ohio-state.edu/software/2221/web-sw1/extras/slides/21.Recursion-Thinking.pdf 

This is the slides of the Software 1 course talking about Recursion in Ohio State. The strength of this source is that it introduced very basic knowledge about recursion and it is good for beginners to get a big picture of recursion at first. But the disadvantage of this source is that it is only a bunch of slides, so it should be presented with instructors lecture. So this source is not enough for learners to master recursion.

slide example

2.

This is a video by the uploader named Derek Banas. This is basically a tutorial of recursion in java. And this introduced from the very start easy part of recursion to hard application problems step by step. I think this video can solve all the introducing and lecturing part of recursion and good for starters.

3.

https://www.geeksforgeeks.org/recursion/

This is basically a page full of helping tips. I think this source’s strength is that it is good for people that are started get into recursion problems practice and met some issues that stopping their progress. This is because tips on this website are based on answers to different problems. For example, one of the questions said: “What are the disadvantages of recursive programming over iterative programming?

4.

https://introcs.cs.princeton.edu/java/23recursion/

This is the part about recursion in Princeton’s Computer Science textbook. The strength of it is that it included all the different problems that we can imaging and offering all the example solutions about it. And also this is from one of the top university of the U.S.

5.

https://codingbat.com/java/Recursion-1

This is a source with actual practice problems. And this source did help me when I was starting to learn about recursion in last semester. The disadvantage is that this source may be too difficult at one point, and it does not offer any solutions. You can only check if your code is right or wrong.