Abstract
As you probably know, recursive programming is a debated technique because it usually needs a lot of memory but it simplifies some programming tasks. Basically, a recursive programming is a situation in which a procedure calls itself, passing in a modified value of the parameter or parameters that were passed in to the current iteration of the procedure. Programming tasks such as calculating factorial, Fibonacci numbers, anagrams, and Sierpinski carpet are just a few of the well-known tasks that can be accomplished through the recursive programming technique. The following code snippet uses this technique to calculate the factorial (n! = 1 * 2 * 3* ... *n)—notice how the procedure calls itself:
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2011 Anghel Leonard
About this chapter
Cite this chapter
Leonard, A. (2011). Recursive Operations: Walks. In: Pro Java 7 NIO.2. Apress. https://doi.org/10.1007/978-1-4302-4012-9_5
Download citation
DOI: https://doi.org/10.1007/978-1-4302-4012-9_5
Publisher Name: Apress
Print ISBN: 978-1-4302-4011-2
Online ISBN: 978-1-4302-4012-9
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)