Algorithms
Algorithm : is a sequence of computational steps that transform the input into the output.
Instance of a problem consists of the input (satisfying whatever constraints are imposed in the problem statement ) needed to compute a solution to the problem.
Correctness of a algorithm : For every input ,it halts with the correct output , or with a incorrect output but we can control what time and how often it happens.
Data Structure : A way to store and organize data in order to facilitate access and modification.
Algorithm as a technology
Efficiency : How long an algorithm take to produce its result.
If a algorithm with f(n) time spends f(n) microseconds solving a problem ,There is the number of solved in the time .
1 second | 1 minute | 1 hour | 1 day | 1 month | 1 year | 1 century | |
---|---|---|---|---|---|---|---|
lgn | 2106 | 26⋅107 | 236⋅108 | 2864⋅108 | 225920⋅108 | 2315360⋅108 | 231556736⋅108 |
n√ | 1012 | 36⋅1014 | 1296⋅1016 | 746496⋅1016 | 6718464⋅1018 | 994519296⋅1018 | 995827586973696⋅1016 |
n | 6⋅107 | 36⋅108 | 864⋅108 | 2592⋅109 | 31536⋅109 | 31556736⋅108 | |
nlgn | 62746 | 2801417 | 133378058 | 2755147513 | 71870856404 | 797633893349 | 68654697441062 |
n2 | 1000 | 7745 | 60000 | 293938 | 1609968 | 5615692 | 56175382 |
n3 | 100 | 391 | 1532 | 4420 | 13736 | 31593 | 146677 |
2n | 19 | 25 | 31 | 36 | 41 | 44 | 51 |
n! | 9 | 12 | 13 | 15 | 16 | 17 |
Some of above content refere to “Introduction to Algorithm”.