Algorithms in programming

 

TMA#1 Activity 1.8 Blog post



   Algorithms in programming


    What is an Algorithm?


   An algorithm is a set of step by step instructions for solving a problem to achieve a result’. Algorithms    are especially important to computers because computers are general purpose machines for solving  problems. In order for a computer to be useful, we must give it a problem to solve and a technique for solving the problem.


How does the algorithm in programming make working so easy?


  The subject field of algorithms has grown so deep and wide that the theories and the basics that are laid down will help us attack any computational problem. There are so many efficient algorithms that are already published like binary search, bubble sort, insertion sort, merge sortquick sort, Euclid’s algorithms to find the GCM, Prim’s algorithms to find the shortest path in the graph, etc.

There are so many kinds of algorithms like –

Brute force algorithmsWhich are straightforward trial and error approaches to solving problems? Just like you do, repeat addition to find the result of a multiplication problem.
Divide and Conquer algorithmsThis breaks the problem into small subproblems and then combines each subproblem result to get the final result. Just like you first segregate the coins of different denominations into different buckets and then count the number of coins in each bucket to find how many coins of individual denominations are there.
Greedy algorithmsThis follows a problem-solving heuristic to reach the next best state to find the final best state. Just like you find the less steep area which climbing a mountain for ease.
Dynamic programmingAn approach that is the same as divide and conquers but divides the problem into subproblems such that their results are reusable for other subproblems.

There is no generally accepted single formal definition for an algorithm. Here is one definition. 

 100 An algorithm is a well-ordered collection of unambiguous and effectively computable operations that when executed produces a result and halts in a finite amount of time. (Schneider and Gersting 1995) Though the algorithm given to illustrate ‘how to make a cup of tea’ seems alright for us, undoubtedly it is too ambiguous for a computer. In order for an algorithm to be applicable to a computer, it must have certain characteristics. According to the formal definition given above, there are five important characteristics of an algorithm as stated below.


 ▪ An algorithm is well-ordered.
 ▪ An algorithm has unambiguous operations.
 ▪ An algorithm has effectively computable operations. 
 ▪ An algorithm produces a result.
 ▪ An algorithm halts in a finite amount of time. 

Comments

Popular posts from this blog

How I Battle My Negative Thinking