Introduction –
Algorithms Design Techniques : We have seen may algorithms for solving different kinds of problems. Before solving a problem, the general tendency is to look for the similarity of the current problem to other problems for which we have solutions. This helps us in getting the solutions easily.
Classification –
There are many ways of classifying algorithms design techniques and a few of them are shown below:
- Implementation method
- Design method
- Other classifications
Classification by Implementation Method –
Recursion or Iteration
Q recursive algorithm is one that calls itself repeatedly until a base condition is satisfiy. It is a common method use in functional programming languages like C, C++, etc.
Iterative algorithms use constructs like loops and sometimes other data structures like stacks and queues to solve the problems.
Some problems are suite for recursive and others are suite for iterative. For example, the Towers of Hanoi problem can be easily understand in recursive implementation. Every recursive version has an iterative version, and vice versa.
Procedural or Declararive (Non-Procedural)
In declarativeprogramming languages, we say what we want without having to say how to do it. With procedural programming, we have to specify the exact steps to get result. For example, SQL is more declarative than procedural, because the queries don’t specify the steps to produce the result. Examples of procedural languages include: C, PHP, and PERL.
Serial or Parallel or Distributed
In general, while discussing the algorithms we assume that computers execute one instruction at a time. These are call as serial algorithms. Parallel algorithms take advantage of computer architectures to process several instructions at a time. They divide the problem into subproblems and serve the m to several processes or threads. Iterative algorithms are generally parallelizable.
If The parallel algorithms are distribute on to different machines then we call such algorithms distribute algorithms.
Deterministic or Non-Deterministic
Deterministic algorithms solve the solve the problem with a predefine process, whereas non-deterministic algorithims guess the best solution at each step through the use of heuridtics.