- 1、本文档共60页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
2004ioi讲义
12 Jun 2004 IOI/ACM/Supercom Session 7 IOI/ACM/Supercom 2004 Training Session 7 Dr Kan Min-Yen Topics and outline Sorting Computer Arithmetic and Algebra Invariants and Number Theory Sorting Problems and Parameters Comparison-based sorting Non-comparison-based What sort of problems? Sorting is usually not the end goal, but a prerequisite _________ _________ _________ _________ _________ Two properties of sorting Stable Items with the same value are ordered in the same way after the sort as they were before Important for doing ____________ sorts E.g., sorting by First name, Last name In-place: sorts the items without needing extra space ___________________________________ Comparison-based sort Based on comparing two items Many variants, but not the only way to sort Discuss only the important ones for programming contests Selection, Insertion, Merge and Quick Comparison Sorts Comparison Sort Animation: /TMCM/java/xSortLab/ Selection Algo: find min or max of unsorted portion Heapsort: is selection sort with heap data structure Remember: ____________________ Insertion Algo: insert unsorted item in sorted array Remember: ____________________ Comparison Sorts Merge Idea: divide and conquer, recursion Algo: merge two sorted arrays in linear time Remember: _________________________ Quick Idea: randomization, pivot Algo: divide problem to smaller and larger half based on a pivot Remember: ________________________! A problem with sorting as its core may not be best solved with generic tool. Think before using a panacea like Quicksort. Miscellaneous sort Most sorting relies on comparisons between two items. Proven to be Θ(n log n) Example: sort an array of distinct integers ranged 1-k We’ll go over Radix sort Counting sort What is radix? Radix is the same as base. In decimal system, radix = 10. For example, the following is a decimal number with 4 digits Radix Sort Suppose we are given n d-digit decimal integers A[0..n-1], radix sort tries to do the following: for
您可能关注的文档
- 08年江苏村官考试真题及答案解析.doc
- 07 04 结构力学 答案.doc
- 07动量守恒定律的应用3.ppt
- 08-09课表.doc
- 04现代包装.ppt
- 07力法2.ppt
- 12-13.1课表(11级修改后课表).doc
- 13.2动量守恒定律的应用.ppt
- 1.2社会经济发展的道路.ppt
- 15《猫》导学案.doc
- 必威体育精装版六年级下册道德与法治期末测试卷及完整答案一套.docx
- 内蒙古草原兴发集团校园招聘85人公开引进高层次人才和急需紧缺人才笔试参考题库答案详解版1套.docx
- 农夫山泉股份有限公司校园招聘模拟试题附带答案详解学生专用.docx
- 利胜电光源(厦门)有限公司校园招聘85人公开引进高层次人才和急需紧缺人才笔试参考题库答案详解版完整版.docx
- 四川沱牌集团有限公司校园招聘85人公开引进高层次人才和急需紧缺人才笔试参考题库答案详解版及参考答案.docx
- 南京长江机器集团有限公司校园招聘85人公开引进高层次人才和急需紧缺人才笔试参考题库答案详解版审定版.docx
- 部编版小学二年级上册道德与法治期中测试卷及完整答案.docx
- 青岛版三年级上册数学期末考试试卷精品含答案.docx
- 苏教版一年级下册数学第二单元 认识图形(二) 测试卷及答案【夺冠系列】.docx
- 部编版二年级下册道德与法治 期末考试试卷附完整答案(全优).docx
最近下载
- 辩论赛培训PPT课件.pptx
- 2025年天津继续教育公需课考试答案-为中国式现代化提供强大动力和制度保障.docx VIP
- 一起非法运输烟花爆竹药料爆炸事故-事故案例-案例分析-爆炸事故.docx
- 11-《卓有成效的管理者》电子版.pdf
- 新青岛版六年级下册科学15太阳系(动画版).pptx
- Haier海尔241升风冷定频两门冰箱 BCD-241WDCV说明书用户手册.pdf
- 2025年部编版新教材语文小学一年级下册全册教案(含教学计划).docx
- 【高考生物】备战2025年高考易错题(新高考专用)易错点14 群落常见的“四个”理解误区(原卷版).docx
- 党风培训ppt课件.pptx VIP
- 领湃科技:衡阳弘新建设厂房和附属设施设备、机器设备租金价值资产评估报告.docx
文档评论(0)