- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
O Analysis of Methods and Data Structures
O Analysis of Methods and Data Structures Reasonable vs. UnreasonableAlgorithms Using O Analysis in Design Now Available Online! O Analysis of Methods and Data Structures The Scenario We’ve talked about data structures and methods to act on these structures… Linked lists, arrays, trees Inserting, Deleting, Searching, Traversal, Sorting, etc. Now that we know about O notation, let’s discuss how each of these methods perform on these data structures! Recipe for Determining O Break algorithm down into “known” pieces We’ll learn the Big-Os in this section Identify relationships between pieces Sequential is additive Nested loop / recursion is multiplicative Drop constants Keep only dominant factor for each variable Array Size and Complexity How can an array change in size? MAX is 30 ArrayType definesa array[1..MAX] of Num We need to know what N is in advance to declare an array, but for analysis of complexity, we can still use N as a variable for input size. Traversals Traversals involve visiting every element in a collection. Because we must visit every node, a traversal must be O N for any data structure. If we visit less than N elements, then it is not a traversal. Comparing Data Structures and Methods Data Structure Traverse Unsorted L List N Sorted L List N Unsorted Array N Sorted Array N Binary Tree N BST N FB BST N Searching for an Element Searching involves determining if an element is a member of the collection. Simple/Linear Search: If there is no ordering in the data structure If the ordering is not applicable Binary Search: If the data is ordered or sorted Requires non-linear access to the elements Simple Search Worst case: the element to be found is the Nth element examined. Simple search must be used for: Sorted or unsorted linked lists Unsorted array Binary tree Binary Search Tree if it is not full and balanced Comparing Data Structures and Methods Data Structure Traverse Search Unsorted L List N N Sorted L List N N U
您可能关注的文档
最近下载
- ASTMA182-2015中文.PDF VIP
- 2025云南玉溪红塔实业有限责任公司员工招聘25人笔试备考试题及答案解析.docx VIP
- 2018湖北省施工机具使用费定额.pdf
- 25公安冲刺110考点 -更新版.pdf VIP
- 第三届全国生态环境监测专业技术人员大比武吉林省赛试题库资料(含答案).pdf
- (正式版)DB23∕T 3711-2024 《市县级矿产资源总体规划编制技术规程》.pdf VIP
- 工业设计审计报告范文.pdf VIP
- 丸红株式会社电子材料介绍.ppt VIP
- 2025年西式面点师(高级)实操技能与理论知识考核试题.docx VIP
- JBL_MS202 迷你桌面音响 说明书.pdf VIP
原创力文档


文档评论(0)