- 7
- 0
- 约7.38千字
- 约 25页
- 2017-11-26 发布于河南
- 举报
北京邮电大学 计算机学院 离散数学 3.2-Growth of Functions
College of Computer Science Technology, BUPT Discrete Mathematical Structures Yang Juan yangjuan@bupt.edu.cn College of Computer Science Technology Beijing University of Posts Telecommunications Growth of Functions(函数增长) * * College of Computer Science Technology, BUPT The Growth of Functions We quantify the concept that g grows at least as fast as f. What really matters in comparing the complexity of algorithms? We only care about the behavior for large problems. Even bad algorithms can be used to solve small problems. Ignore implementation details such as loop counter incrementation, etc. We can straight-line any loop. * * College of Computer Science Technology, BUPT Orders of Growth (§3.2) For functions over numbers, we often need to know a rough measure of how fast a function grows. If f(x) is faster growing than g(x), then f(x) always eventually becomes larger than g(x) in the limit (for large enough values of x). Useful in engineering for showing that one design scales better or worse than another. * * College of Computer Science Technology, BUPT Orders of Growth - Motivation Suppose you are designing a web site to process user data (e.g., financial records). Suppose database program A takes fA(n)=30n+8 microseconds to process any n records, while program B takes fB(n)=n2+1 microseconds to process the n records. Which program do you choose, knowing you’ll want to support millions of users? * * College of Computer Science Technology, BUPT Visualizing Orders of Growth On a graph, asyou go to theright, the faster-growing func-tion always eventuallybecomes thelarger one... fA(n)=30n+8 Increasing n ? fB(n)=n2+1 Value of function ? * * College of Computer Science Technology, BUPT Concept of order of growth We say fA(n)=30n+8 is (at most) order n, or O(n). It is, at most, roughly proportional to n. fB(n)=n2+1 is order n2, or O(n2). It is (at most) roughly proportional to n2. Any function whose exact (tightest) order is O(n2) is faster-growing than
您可能关注的文档
最近下载
- 2025-2026学年小学劳动人美版2024五年级下册-人美版(2024)教学设计合集.docx
- 2025年青岛酒店管理职业技术学院单招笔试英语试题库含答案解析.docx VIP
- 海藻学-3.pdf VIP
- 东风天龙电气系统维修.ppt VIP
- 2026人教版小学语文四年级上册期末考试精选3套试卷(含答案解析).pdf
- 《出纳实务》高职财经专业全套教学课件.pptx
- 毕业论文的答辩与评价.ppt VIP
- 药品质量研究的内容与药典概况详解.ppt VIP
- 西门子通风控制器acx36介绍.pdf
- 2024年青岛酒店管理职业技术学院高职单招(英语/数学/语文)笔试历年参考题库含答案解析.docx VIP
原创力文档

文档评论(0)