We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Technology

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is a Recursion?

By Troy Holmes
Updated: May 17, 2024
Views: 5,582
Share

In computer science, many problems require a divide-and-conquer strategy. The technique of recursion uses this strategy. In its simplest form, recursion is a function that divides a problem into smaller problems until the final product can be determined. Computer science was founded on a platform of mathematics and logic. Recursion has been a part of this larger framework for many decades and it can be found in most computer programming languages today.

Dynamic programming is an implementation of recursion, which breaks a problem into components. This process enables the nesting of problems within larger problems where each sub problem requires the result from the prior problem. This type of functional recursion is typical within array manipulation.

This style of programming is beneficial because it simplifies a problem into manageable components. It also has the benefit of modular software development. This modular approach enables the creation of reusable components throughout a computer application.

Recursion works well when creating security features within computer applications. Each screen of an application may require specific business rules that determine if fields should be visible. Rather then write individual security code on each screen, a recursive function can be created to read all screens before rendering the data to the user and applying the necessary restrictions of visibility.

Graphics design is another area that fits well for a recursive problem. Imagine a program that was designed to create a square within a square. The smaller square would have the same functional requirements of the larger square with the only change being the dimensions of the two squares.

A sorting algorithm is a logical problem where a list of items must be sorted in a specific order. This type of problem resolution requires the constant shuffling of a list into a new list, until the final list is ordered as desired. A good approach to solving this problem is to create a recursive loop that continues shuffling the list until it is sorted into the final list.

The power of software automation makes the use of recursion seem trivial to most system owners. It is typically expected that security features and sorting of columns requires a simple click of a mouse or the stroke of a keyboard. Under the covers of this simple action lies the complexity and elegance of recursion in practice.

Share
WiseGeek is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.

Editors' Picks

Discussion Comments
Share
https://www.wisegeek.net/what-is-a-recursion.htm
Copy this link
WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.

WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.