Skip to main content Accessibility help
×
Hostname: page-component-78c5997874-dh8gc Total loading time: 0 Render date: 2024-11-13T00:47:50.458Z Has data issue: false hasContentIssue false

8 - Recursion

from PART ONE - FOUNDATIONS

Published online by Cambridge University Press:  05 June 2012

Richard Wiener
Affiliation:
University of Colorado, Colorado Springs
Lewis J. Pinson
Affiliation:
University of Colorado, Colorado Springs
Get access

Summary

An essential and important part of computer problem solving is the development of algorithms – the detailed logic and steps required to solve a problem. All programmers are introduced very early to a number of useful programming constructs for building algorithms. These include assignment, branching, and iteration. Branching provides a means for conditional or alternative execution of steps in an algorithm. Iteration provides a convenient way to perform repetitive steps. Without branching and iteration the algorithms for even simple problem solutions would be either impossible or verbose and cumbersome. Another useful concept for construction of algorithms is recursion. Recursion is a construct that provides an alternative to iteration for repetitive steps. In many problems requiring repetitive steps we may find equivalent iterative and recursive algorithms as solutions.

What is recursion? A recursion may be described as the process of executing the steps in a recursive algorithm. So what is recursive? We sometimes tell our students, “If you look up ‘recursive’ in the dictionary, its definition is ‘see recursive.’” We deduce from this anecdotal definition that a recursive algorithm is defined in terms of itself. The actual definition found in one dictionary, “pertaining to or using a rule or procedure that can be applied repeatedly,” is not very helpful.

In developing an understanding for recursion we rely on its use in mathematics, algorithms, and computer programming. From mathematics we find recursive functions defined in terms of themselves.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2000

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Recursion
  • Richard Wiener, University of Colorado, Colorado Springs, Lewis J. Pinson, University of Colorado, Colorado Springs
  • Book: Fundamentals of OOP and Data Structures in Java
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511807176.009
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Recursion
  • Richard Wiener, University of Colorado, Colorado Springs, Lewis J. Pinson, University of Colorado, Colorado Springs
  • Book: Fundamentals of OOP and Data Structures in Java
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511807176.009
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Recursion
  • Richard Wiener, University of Colorado, Colorado Springs, Lewis J. Pinson, University of Colorado, Colorado Springs
  • Book: Fundamentals of OOP and Data Structures in Java
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511807176.009
Available formats
×