Algorithms in programming
TMA#1 Activity 1.8 Blog post
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 sort, quick 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 algorithms | Which 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 algorithms | This 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 algorithms | This 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 programming | An approach that is the same as divide and conquers but divides the problem into subproblems such that their results are reusable for other subproblems. |
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.
Comments
Post a Comment