O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this chapter, you learned about the essentials of recursion. Apart from looking at the theoretical foundation for recursion, you also were presented with a couple of typical recursion examples.

The important points covered in this chapter are reviewed in this section.

When a method calls itself from within its own method body, the method is called a recursive method. The use of recursive methods is called recursion.

Recursive method calls result in pending method instances of the recursive method.

A successful recursive method contains a branching statement, one or more base cases, and one or more recursive calls. Each recursive call must move toward the base case to avoid infinitely many recursive calls.

Recursion is suited to solve ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required