- 3
- 0
- 约2.79千字
- 约 43页
- 2020-08-30 发布于湖北
- 举报
Instance simplification - Presorting;How fast can we sort ?;Searching with presorting;Element Uniqueness with presorting;Instance simplification – Gaussian Elimination;Gaussian Elimination (cont.);Example of Gaussian Elimination;大家学习辛苦了,还是要坚持;Pseudocode and Efficiency of Gaussian Elimination;Searching Problem;Taxonomy of Searching Algorithms;Binary Search Tree;Dictionary Operations on Binary Search Trees;Balanced Search Trees ;;;General case: Single R-rotation;General case: Double LR-rotation;;;Analysis of AVL trees;Multiway Search Trees;2-3 Tree ;2-3 tree construction – an example;Analysis of 2-3 trees;Heaps and Heapsort;Illustration of the heap’s definition;Some Important Properties of a Heap;Heap’s Array Representation;Step 0: Initialize the structure with keys in the order given
Step 1: Starting with the last (rightmost) parental node, fix the heap rooted at it, if it doesn’t satisfy the heap condition: keep exchanging it with its largest child until the heap condition holds
Step 2: Repeat Step 1 for the preceding parental node
;Example of Heap Construction;Pseudopodia of bottom-up heap construction;Stage 1: Construct a heap for a given list of n keys
Stage 2: Repeat operation of root removal n-1 times:
Exchange keys in the root and in the last (rightmost) leaf
Decrease heap size by 1
If necessary, s root with larger child until the heap condition holds
;Sort the list 2, 9, 7, 6, 5, 8 by heapsort
Stage 1 (heap construction) Stage 2 (root/max removal)
1 9 7 6 5 8 9 6 8 2 5 7
2 9 8 6 5 7 7 6 8 2 5 | 9
2 9 8 6 5 7 8 6 7 2 5 | 9
9 2 8 6 5 7 5 6 7 2 | 8 9
9 6 8 2 5 7 7 6 5 2 | 8 9
2 6 5 | 7 8 9
6 2 5 | 7 8 9
5 2 | 6 7 8 9
5 2 | 6 7 8 9
2 | 5 6 7 8 9;Stage 1: Build heap for a given list of n ke
您可能关注的文档
最近下载
- 北师大版一年级数学下册(全册)同步练习随堂练习一课一练.pdf VIP
- 汽车机械基础-模块二 汽车机械设计基础.pptx VIP
- 黑布林英语阅读《小妇人》 - 中英伴读.pdf VIP
- 0306.第3章-农村改革实践与探索6.pdf VIP
- 2025年湖南省中考数学真题试卷(含答案).pdf VIP
- (天一大联考)陕西山西宁夏青海2025-2026学年(上)高三第一次四省联考 英语试卷(含答案详解).pdf
- 2026反假货币培训考试题库200道附答案(满分必刷).docx VIP
- 2025年江西现代职业技术学院单招笔试综合素质试题库含答案解析(5套卷).docx VIP
- 装配式建筑混凝土预制构件安装工程(附详细工艺流程与质量安全措施).docx VIP
- 2026反假货币培训考试题库200道(满分必刷).docx VIP
原创力文档

文档评论(0)