Part 07 Skip List and Hashing-FL
简介
---
(
&
)
简介
Skip List and Hashing
Concept& Implementation of Dictionary– Skip list, Hashing
Application of Hashing– LZW compression (Learn by yourself)
Part VII Dictionary
简介
Dictionary A dictionary is a collection of elements Each element has a field called keyThe general three skills for Every key is usually distinct DSA– most Typical dictionary operations are: S(earch) I(nsert).D(elete).– Determine whether or not the dictionary is empty– Determine the dictionary size (i.e.,# of pairs)– Insert a pair into the dictionary– Search the pair with a specified key– Delete the pair with a specified keyPPTs from others\dpnm.postech.ac.kr_cs233_lecture\lecture7.pptPart VII Dictionary 3
– (key, value)
简介
Accessing Dictionary Elements Random Access– Any element in the dictionary can be retrieved by simply performing a search on its key
Sequential Access– Elements are retrieved one by one in ascending order of the key field– Sequential Access Operations: Begin– retrieves the element with smallest key Next– retrieves the next elementPPTs from others\dpnm.postech.ac.kr_cs233_lecture\lecture7.pptPart VII Dictionary 4
简介
Dictionary with Duplicates Keys are not required to be distinct Word dictionary is such an example– Pairs are of the form (word, meaning)– May have two or more entries for the same word– For example, the meanings of the word, rank: (rank, a relative position in a society) (rank, an official position or grade) (rank, to give a particular order or position to) PPTs from others\dpnm.postech.ac.kr_cs233_lecture\lecture7.ppt etc. Part VII Dictionary 5
简介
Application of Dictionary Collection of student records in a class– (key, value)= (student-number, a list of assignment and exam marks)– All keys are distinct
Get the element whose key is Tiger Woods Update the element whose key is Seri Pak Exercise: Give other real-world applications of dictionaries and/or dictionaries with duplicatesPPTs from others\dpnm.postech.ac.kr_cs233_lecture\lecture7.pptPart VII Dictionary 6
简介
ADT 7.1 for the abstract data type Dictionary
Part VII Dictionary
简介
Skip List and Hashing
Concept& Implementation of Dictionary– Skip list, Hashing
Application of Hashing– LZW compression (Learn by yourself)
Part VII Dictionary
简介
Skip list The search operation on a sorted array using the binary search method takes O(logn) The search operation on a sorted chain takes O(n) How can we improve the search performance of a sorted chain? By putting additional pointers in some of the chain nodes
Chains augmented with additional forward pointers are called skip listsPPTs from others\dpnm.postech.ac.kr_cs233_lecture\lecture7.pptPart VII Dictionary 9
简介
Skip Lists Skip lists improve the performance of insert and delete operations Employ a randomization technique to determine where and
how many to put additional forward pointers The expected performance of search and delete operations on skip lists is O(logn) However, the worst-case performance is (n)PPTs from others\dpnm.postech.ac.kr_cs233_lecture\lecture7.pptPart VII Dictionary 10
简介
Dictionary as a Skip List Read Example 7.3 and see Figure 7.1 for– A sorted chain with head and tail nodes– Adding forward pointers– Search and insert operations in skip lists
For general n, the level 0 chain includes all elements Level 1 chain includes every second element Level 2 chain includes every fourth element Level i chain includes 2ith element An element is a level i element iff it is in the chains for levels 0 through iPPTs from others\dpnm.postech.ac.kr_cs233_lecture\lecture7.pptPart VII Dictionary 11
简介
Skip List– pointer levels
level 0 chain PPTs from others\dpnm.postech.ac.kr_cs233_lecture\lecture7.ppt includes all elements Level 1 chain includes every second element
Level 2 chain includes every fourth elementPart VII Dictionary 12
简介
Skip List– search“77”
We have learned that the average comparison number is“?” when searching some element in the chain. - Yes, it is (n+1)/2=[(n/20)+1]/2, namely O(n) As for“77” here, we have to compare all the elements!
Part VII Dictionary
简介
Skip List– search
When searching some element in the level 1 skip list, we can conclude the average comparison number is[(n/21)+1]/2+(21+1)/2
As for“77” here, we have to compare 4 elements!Part VII Dictionary 14
简介
Skip List– search
When searching some element in the level 2 skip list, we can conclude the average comparison number is[(n/22)+1]/2+(n/23+1)/2+(21+1)/2
As for“77” here, we have to compare 3 elements!Part VII Dictionary 15
简介
Skip List– search Conclusion– When searching some element in the level i Based on the skip list, we can conclude the average knowledge of comparison number is in skip list, searching[(n/2i)+1]/2+(/n2i+1+1)/2+(/n2i+2+1)/2+…+ we can see that it is a 1+1)/2+(2 kind of simulation of– Asymptotic O(logn)
Binary Search!
Part VII Dictionary
…… 此处隐藏:2873字,全部文档内容请下载后查看。喜欢就下载吧 ……相关推荐:
- [法律文档]苏教版七年级语文下册第五单元教学设计
- [法律文档]向市委巡视组进点汇报材料
- [法律文档]绵阳市2018年高三物理上学期第二次月考
- [法律文档]浅析如何解决当代中国“新三座大山”的
- [法律文档]延安北过境线大桥工程防洪评价报告 -
- [法律文档]激活生成元素让数学课堂充满生机
- [法律文档]2014年春学期九年级5月教学质量检测语
- [法律文档]放射科标准及各项计1
- [法律文档]2012年广州化学中考试题和答案(原版)
- [法律文档]地球物理勘查规范
- [法律文档]《12系列建筑标准设计图集》目录
- [法律文档]2018年宁波市专技人员继续教育公需课-
- [法律文档]工会委员会工作职责
- [法律文档]2014新版外研社九年级英语上册课文(完
- [法律文档]《阅微草堂笔记》部分篇目赏析
- [法律文档]尔雅军事理论2018课后答案(南开版)
- [法律文档]储竣-13827 黑娃山沟大开挖穿越说明书
- [法律文档]《产品设计》教学大纲及课程简介
- [法律文档]电动吊篮专项施工方案 - 图文
- [法律文档]实木地板和复合地板的比较
- 探析如何提高电力系统中PLC的可靠性
- 用Excel函数快速实现体能测试成绩统计
- 教师招聘考试重点分析:班主任工作常识
- 高三历史选修一《历史上重大改革回眸》
- 2013年中山市部分职位(工种)人力资源视
- 2015年中国水溶性蛋白市场年度调研报告
- 原地踏步走与立定教学设计
- 何家弘法律英语课件_第十二课
- 海信冰箱经销商大会——齐俊强副总经理
- 犯罪心理学讲座
- 初中英语作文病句和错句修改范例
- 虚拟化群集部署计划及操作流程
- 焊接板式塔顶冷凝器设计
- 浅析语文教学中
- 结构力学——6位移法
- 天正建筑CAD制图技巧
- 中华人民共和国财政部令第57号——注册
- 赢在企业文化展厅设计的起跑线上
- 2013版物理一轮精品复习学案:实验6
- 直隶总督署简介




