Subalgorithms
A subalgorithm is a self-contained algorithm that is invoked as a component of a larger algorithm to perform a specific subtask. It has a well-defined input and output, a termination condition, and a measurable time and space complexity. In many texts, subalgorithms are treated as building blocks or modules, similar to subroutines or procedures in programming, but with an emphasis on algorithmic structure rather than implementation details.
Subalgorithms support modular design, allowing abstraction and reuse. A larger algorithm may call a subalgorithm multiple
Examples include: in graph algorithms, BFS or DFS are common subalgorithms used for traversal inside more complex
Theoretical and practical considerations: the concept helps in formal analysis by isolating subproblems and clarifying dependencies.