go to previous page   go to home page   go to next page

Answer:

The Universal Flow Chart.


New Problem

The Universal Flow Chart deals with the usual case where the problem splits into pieces which can be handled one-by-one in sequence. But if there are special cases where the problem can be solved immediately, handle them first. This sounds an awful lot like recursion.

You have likely seen the Fibonacci Series before. This is a series of integers, where the n'th integer is the series is given by

 Fib( 1 ) == 1
 Fib( 2 ) == 1
 Fib( n ) == Fib(n-1) + Fib(n-2)
 

The first few terms of the series are

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ... 

QUESTION 7:

What are the special cases that might be handled with early returns?