next up previous contents
Next: Functions as input parameters Up: Step-wise refinement and Procedural Previous: Examples of step-wise refinement   Contents

Procedural abstraction using higher-order functions

Till now we have only considered functions which accept numbers as input values and return numbers as output values. But even in numerical computations we will be severely restricted if we only consider functions of this type. There may be several computational problems whose algorithmic solutions are based on a common central idea and are similar in structure. In such a case we should be able to abstract out these common features in a high level algorithm which can then be tailored to define solutions to particular problems with these features. Such abstract functions can be written as higher-order functions. Higher order functions are those which can accept functions as arguments and return functions as values. In this section we will illustrate the use of such higher-order functions.



Subsections

Subhashis Banerjee 2003-08-02