Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




Basic Concepts -Sub-Algorithm

A sub-algorithm is an algorithmic module which is complete in itself and has independent existence. It can be used or called by some main algorithm or by some other sub-algorithm. It may or may not receive values from a calling algorithm. These values are called arguments or parameters. The sub-algorithm performs its task and then sends back the result to the calling algorithm. It can be called by many different algorithms or called at different places in the same algorithm. The relationship between an algorithm and a sub-algorithm is similar to the relationship between a main program (function) and a sub-program (sub-function) in a programming language.

Usefulness

When the problem is very complex, it is divided into several independent sub-problems. Each sub-problem is called sub-algorithm and can be developed independently. These sub-problems can be combined together to form the solution for the entire problem. Thus by using sub-algorithms the complex problems can be solved easily.

Share this article   |    Print    |    Article read by 12141 times
Author:
Ritika Sood
Lecturer in computer science....Love to do programming...Other interests are sports, freaking out with frnds, travel at beautiful places, watch movies, listen songs....
Related Articles: No related article
Related Interview Questions: No related interview question