Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to represent a recursive function with a Flow Chart?

I need to represent a recursive function on a flow chart. My problem is that I don't know how to indicate that the function may call itself over multiple elements at a time (think for example to a function which scans graphs). Someone has any suggestion?

like image 945
Lorenzo Avatar asked Jul 14 '11 10:07

Lorenzo


People also ask

How do you write a recursive function example?

Simple examples of a recursive function include the factorial, where an integer is multiplied by itself while being incrementally lowered. Many other self-referencing functions in a loop could be called recursive functions, for example, where n = n + 1 given an operating range.

What is recursive flow?

Recursion is the process of executing the same task multiple times.

What is recursion in C flowchart?

Recursion is a routine that calls itself again and again directly or indirectly. There are two types of recursion in the C language Direct calling and Indirect calling. The calling refers to the recursive call.


1 Answers

In a flow chart, you don't normally add multiple invocations for things like loops, you would just indicate that the code may be repetitively called until a condition is met. So, for a recursive function, it would be similar - the base case is a regular step and the recursive step is the same as loop. See this for an example.

like image 52
manku Avatar answered Oct 19 '22 02:10

manku