Introduction to Algorithm - Summary of Chapter 1 - The Role of Algorithm in Computing

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 second1 minute1 hour1 day1 month1 year1 century
lgn 2106 26107 236108 2864108 225920108 2315360108 231556736108
n 1012 361014 12961016 7464961016 67184641018 9945192961018 9958275869736961016
n 106 6107 36108 864108 2592109 31536109 31556736108
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 11 12 13 15 16 17

Some of above content refere to “Introduction to Algorithm”.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Picture a computer scientist, staring at a screen and clicking away frantically on a keyboard, hacking into a system, or perhaps developing an app. Now delete that picture. In Once Upon an Algorithm, Martin Erwig explains computation as something that takes place beyond electronic computers, and computer science as the study of systematic problem solving. Erwig points out that many daily activities involve problem solving. Getting up in the morning, for example: You get up, take a shower, get dressed, eat breakfast. This simple daily routine solves a recurring problem through a series of well-defined steps. In computer science, such a routine is called an algorithm. Erwig illustrates a series of concepts in computing with examples from daily life and familiar stories. Hansel and Gretel, for example, execute an algorithm to get home from the forest. The movie Groundhog Day illustrates the problem of unsolvability; Sherlock Holmes manipulates data structures when solving a crime; the magic in Harry Potter’s world is understood through types and abstraction; and Indiana Jones demonstrates the complexity of searching. Along the way, Erwig also discusses representations and different ways to organize data; “intractable” problems; language, syntax, and ambiguity; control structures, loops, and the halting problem; different forms of recursion; and rules for finding errors in algorithms. This engaging book explains computation accessibly and shows its relevance to daily life. Something to think about next time we execute the algorithm of getting up in the morning.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值