Home Web Tools Web Directory Services Accounts
 
html hit counter

You are here:  iWEBTOOL > Computer Glossary > Recursive Function

What is Recursive Function?
A recursive function is a function that calls itself during its execution. This enables the function to repeat itself several times, outputting the result and the end of each iteration. Below is an example of a recursive function.

function Count (integer N)
if (N <= 0) return "Must be a Positive Integer";
if (N > 9) return "Counting Completed";
else return Count (N+1);
end function

The function Count() above uses recursion to count from any number between 1 and 9, to the number 10. For example, Count(1) would return 2,3,4,5,6,7,8,9,10. Count(7) would return 8,9,10. The result could be used as a roundabout way to subtract the number from 10.

Recursive functions are common in computer science because they allow programmers to write efficient programs using a minimal amount of code. The downside is that they can cause infinite loops and other unexpected results if not written properly. For example, in the example above, the function is terminated if the number is 0 or less or greater than 9. If proper cases are not included in the function to stop the execution, the recursion will repeat forever, causing the program to crash, or worse yet, hang the entire computer system.
   
Return to Glossary  

A special thanks to Sharpened Glossary
Popular terms beginning with 'R':
What is RTF?
Stands for "Rich Text Fomat." This is a file format standardized by Microsoft for creating formatted text files. Unlike a basic text file, an RTF file can include information such as text style, size,... continue

What is ROM?
Stands for "Read-Only Memory." Please do not confuse this term with RAM or a hard drive, as many people already do. ROM is memory containing hardwired instructions that the computer uses when it boots... continue

What is Referrer?
When visiting a webpage, the referer (sic) or referring page is the URL of the previous webpage from which a link was followed. More generally, it is the URL of a previous item which led to this reque... continue

What is Router?
This is a hardware device that routes data (hence the name) from a local area network (LAN) to another network connection. A router acts like a coin sorting machine, allowing only authorized machines ... continue

What is RUP?
Stands for "Rational Unified Process." RUP is a software development process from Rational, a division of IBM. It divides the development process into four distinct phases that each involve business m... continue

What is Registry?
This is a database used by Microsoft Windows to store configuration information about the software installed on a computer. This information includes things like the desktop background, program settin... continue

What is RGB?
Stands for "Red Green Blue." It refers to the three hues of light (red, green, and blue, for those of you that are a little slow), that can mix together to form any color. When the highest intensity o... continue

What is RAM?
Stands for "Random Access Memory," and is pronounced like the male sheep. RAM is made up of small memory chips that are connected to the motherboard of your computer. Everytime you open a program, it ... continue

What is Runtime?
When a program is running, or executing, it is said to be in runtime. The term is mostly used by software developers to specify when errors in a program occur. A "runtime error" is an error that happe... continue

What is Raw Data?
Raw data is unprocessed computer data. This information may be stored in a file, or may just be a collection of numbers and characters stored on somewhere in the computer's hard disk. For example, inf... continue

 
Sponsored Links
Internet Marketing
Online Marketing Agency
ERP Software
Cloud Computing

Add your link here
Only $30 per month

 

Help & Support - Advertise - Copyright © iWEBTOOL 2005-08