Algorithms
An algorithm is the step by step expressly instructions to solve a given problem.
Let us consider the problem of making a maggie.To prepare an maggie, we follow the steps given below
1. Take a pan and put one glass of water according to number of packets.
2. Put the maggie in it and make boil till little water evaporates.
3. After that put the masala in it and stir continously.
4. After some time put in plate and serve it.
In this we are providing the step by step procedures for solving it.
There are two main criteria for judging the merits of algorithms
a, Correctness
b, Efficieny
What is the need to analysis of Algorithms ?
If someone wants to move from city A to city B by any means of transport like bus, train or flight. Depending upon the convenience and source available to person, Person will choose the particular mode.Similarly, in computer science multiple algorithms are available for solving the same problem.
For example : Sorting have multiple sorting algorithms such as bubble sort, insertion sort, radix sort and so on.
Algorithmic analysis help us to determine which algorithms is best suited and chosen in a particular scenario.
Goal of the Analysis of Algorithms :
The main aim is to compare the all algorithms such that wisely chosen the algorithms in terms of the running time and other factor also play a vital role in that such that memory management etc.
What is Running Time analysis
It is the process of the determining how the processing time increases as the size of the problem i.e the input size increases.Input size is the number of the elements in the input, and depending on the problem type, the input may be of different types. The following are the common types of inputs.
1. Size of the array
2. Polynomial degree
3. Number of elements in the matrix
4. Number of bits in the binary representation of the input.
How to compare Algorithms
To define a few objective measures :
1. Execution times?
2. Number of the statements executed?
3. Ideal solution?
The factors promote to choose the algorithms is the rate of the growth.
No comments:
Post a Comment