Thursday, November 26, 2015

Identifying Techniques for Designing Algorithms

Designing Algorithms and Measuring their Efficiency

Designing an algorithm for a given problem is a difficult intellectual exercise. This is because there is no systematic method for designing an algorithm. Moreover, there may be more than one algorithm to solve a given problem. Writing an effective algorithm for a new problem or writing a better algorithm for an already existing algorithm is art as well as science because it requires both, creativity and insight.

Identifying Techniques for Designing Algorithms

Although there is no systematic method for designing an algorithm, there are some well-known techniques that have proved to be quite useful in designing algorithms. The following two techniques are commonly used for designing algorithms:

  •  Divide and conquer approach 
  • Greedy approach 


 Divide and conquer approach 

The divide and conquer approach is an algorithm design technique that involves breaking down a problem recursively into sub problems until the sub problems become so small and trivial that they can be easily solved. The solutions to the sub problems are then combined to give a solution to the original problem. Divide and conquer is a powerful approach for solving conceptually difficult problems. It simply requires you to find a way of breaking the problem into sub problems, solving the trivial cases, and combining the solutions to the sub problems to solve the original problem. Divide and conquer often provides a natural way to design efficient algorithms. 


Greedy Approach

 The greedy approach is an algorithm design technique that selects the best possible option at a given time. Algorithms based on the greedy approach are used for solving optimization problems where you need to maximize profits or minimize costs under a given set of conditions.

No comments:

Post a Comment