版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、1,Binary Search tree, red-black tree, and AVL tree Example Hash Function Open probe addressing Chaining with separate lists (2 slide) Hash Iterator Efficiency of Hash Methods Binary Search Trees 2-3-4 Tree (2 slides) Insertion of 2-3-4 tree (4 slides) Red-Black Trees,Chapter 12 Advanced Associative
2、Structures,Converting 2-3-4 tree to Red-Black tree Four Situations in the Splitting of a 4-Node: left child of a BLACK parent P prior to inserting node oriented left-left from G using a single right rotation oriented left-right from G after the color flip Building a Red-Black Tree (2 slides) Red-Bla
3、ck Tree Representation Summary Slide (8 slides),2,Binary Search Tree, Red-Black Tree and AVL Tree Example,3,Example Hash Function,4,Example Hash Function,5,Hash Table Using Open Probe Addressing Example,6,Chaining with Separate Lists Example,7,Hash Iterator hIter Referencing Element 22 in Table ht,8
4、,Efficiency of Hash Methods,9,Two Binary Search Tree Example,Insertion sequence: 5, 15, 20, 3, 9, 7, 12, 17, 6, 75, 100, 18, 25, 35, 40,10,2-3-4 Tree Method,11,2-3-4 Tree Example,12,Example of Insertion of 2-3-4 Tree,13,Another Example of Insertion of 2-3-4 Tree,Insertion Sequence: 2, 15, 12, 4, 8,
5、10, 25, 35, 55, 11, 9, 5, 7,14,Another Example of Insertion of 2-3-4 Tree (Cont),15,Another Example of Insertion of 2-3-4 Tree (Cont),16,Red-Black Trees,17,Converting a 2-3-4 Tree to Red-Black Tree Example,18,Four Situations in the Splitting of a 4-Node,19,Left child of a Black parent P,20,Prior to
6、inserting node 55,21,Oriented left-left from G Using A Single Right Rotation,22,Oriented Left-Right From G After the Color Flip,23,Building A Red-Black Tree,24,Building A Red-Black Tree (Cont),25,rbnode Representation of Red-Black Tree,26,Summary Slide 1,- Hash Table - simulates the fastest searchin
7、g technique, knowing the index of the required value in a vector and array and apply the index to access the value, by applying a hash function that converts the data to an integer - After obtaining an index by dividing the value from the hash function by the table size and taking the remainder, acc
8、ess the table. Normally, the number of elements in the table is much smaller than the number of distinct data values, so collisions occur. - To handle collisions, we must place a value that collides with an existing table element into the table in such a way that we can efficiently access it later.,
9、27,Summary Slide 2,- Hash Table (Cont) - average running time for a search of a hash table is O(1) - the worst case is O(n),28,Summary Slide 3,- Collision Resolution - Two types: 1) linear open probe addressing - the table is a vector or array of static size - After using the hash function to comput
10、e a table index, look up the entry in the table. - If the values match, perform an update if necessary. - If the table entry is empty, insert the value in the table.,29,Summary Slide 4,- Collision Resolution (Cont) - Two types: 1) linear open probe addressing - Otherwise, probe forward circularly, l
11、ooking for a match or an empty table slot. - If the probe returns to the original starting point, the table is full. - you can search table items that hashed to different table locations. - Deleting an item difficult.,30,Summary Slide 5,- Collision Resolution (Cont) 2) chaining with separate lists.
12、- the hash table is a vector of list objects - Each list is a sequence of colliding items. - After applying the hash function to compute the table index, search the list for the data value. - If it is found, update its value; otherwise, insert the value at the back of the list. - you search only ite
13、ms that collided at the same table location,31,Summary Slide 6,- Collision Resolution (Cont) - there is no limitation on the number of values in the table, and deleting an item from the table involves only erasing it from its corresponding list,32,Summary Slide 7,- 2-3-4 tree - a node has either 1 value and 2 children, 2 values and 3 children, or 3 values and 4 children - construction of 2-3-4 trees is comp
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025吉林長春市南關(guān)區(qū)面向社會(huì)招聘產(chǎn)業(yè)緊缺人才65人備考題庫附答案
- 數(shù)據(jù)標(biāo)注員崗前環(huán)保競賽考核試卷含答案
- 2024年淮南市特崗教師筆試真題匯編附答案
- 2025年云南農(nóng)業(yè)職業(yè)技術(shù)學(xué)院輔導(dǎo)員招聘備考題庫附答案
- 2024年甘肅有色冶金職業(yè)技術(shù)學(xué)院輔導(dǎo)員考試筆試真題匯編附答案
- 2024年重慶工商大學(xué)輔導(dǎo)員招聘備考題庫附答案
- 2025年臨夏州特崗教師筆試真題題庫附答案
- 2025年事業(yè)單位招聘考試《《公共基礎(chǔ)知識(shí)》》真題庫帶答案
- 2025山西陽泉市盂縣招(選)聘社區(qū)專職10人(第二批)備考題庫附答案
- 2025年上海外國語大學(xué)輔導(dǎo)員考試筆試真題匯編附答案
- 地坪漆施工方案范本
- 2025寧波市甬北糧食收儲(chǔ)有限公司公開招聘工作人員2人筆試參考題庫及答案解析
- 2026年國有企業(yè)金華市軌道交通控股集團(tuán)招聘備考題庫有答案詳解
- 2025年電子工程師年度工作總結(jié)
- 2026年吉林司法警官職業(yè)學(xué)院單招職業(yè)技能筆試備考題庫帶答案解析
- 2025年高職第三學(xué)年(工程造價(jià))工程結(jié)算與審計(jì)測(cè)試題及答案
- 2024年曲阜師范大學(xué)馬克思主義基本原理概論期末考試真題匯編
- 醫(yī)院消毒技術(shù)培訓(xùn)課件
- 江蘇省電影集團(tuán)招聘筆試題庫2026
- 《機(jī)械創(chuàng)新設(shè)計(jì)》課件-多功能播種機(jī)整體結(jié)構(gòu)設(shè)計(jì)
- 增殖放流效果評(píng)估體系
評(píng)論
0/150
提交評(píng)論