* All cost depth of the node in question. Worst case: ?(n). Average case: ?(log n). NEED TO REPEAT. * * * * * How to get a good number of exchanges? Induction leads to the following algorithm: Heapify the root’s subtrees, then push the root to the correct level. * How to get a good number of exchanges? Induction leads to the following algorithm: Heapify the root’s subtrees, then push the root to the correct level. * * * * * * (i-1) is number of steps down, n/2i is number of nodes at that level. * * current * current * * * C: 1110 D: 101 E: 0 F: 1111 K: 111101 L: 110 U: 100 Z: 111100 * * * C: 1110 D: 101 E: 0 F: 1111 K: 111101 L: 110 U: 100 Z: 111100 * These terms can be hard to distinguish. Students will need to remember which is which, since this notation will be used several times during the course. * This theorem is important, because it helps us to calculate space requirements. It tells us how many nodes are internal and how many are leaf. We need to know this if we have separate implementations for internal and leaf nodes * 最密集和平衡的状态 * Standard implementation (illustrating BinNodePtr class shown earlier). Leaf implementation is identical to internal node implementation, resulting in much wasted space due to null pointers. * * * * * * The first implementation is preferred. The second implementation illustrates a common programming style by many students. It attempts to “look ahead” at the node to be called to determine if it is null or not. This is highly error prone, because the calling function must make sure not to pass in a null pointer for the tree root. It might appear to be more efficient (since it does not make recursive calls on the empty pointers), but it is not in reality since it is checking the pointers twice (to see if not null, then to process them). * The first implementation is preferred. The second implementation illustrates a common programming style by many students. It attempts to “look ahead” at the node to be called to d
您可能关注的文档
最近下载
- 栽培措施对青贮玉米粗蛋白质含量及产量的影响.pdf VIP
- EN IEC 62660-3-2022 Secondary lithium-ion cells for the propulsion of electric road vehicles - Part 3:Safety requirements 电动道路车辆推进用二次锂离子电池. 第3部分: 安全要求.pdf
- 2024年江苏省淮安市中考语文真题试卷含答案.docx
- 安全员(矿山)试题库含参考答案.docx VIP
- 矿山安全员试题库(附参考答案).docx VIP
- Honor荣耀MagicBook Pro 14 用户手册-(FMB-P,01,zh-cn)说明书.pdf
- 选矿厂设计考试试卷及答案.docx VIP
- 社会工作者(初级)考试题库及答案【题库版】.pdf VIP
- 融媒体中心新媒体制作岗位专业测试及答案.docx VIP
- 高考物理一轮复习6.2机械能守恒定律-动能定理及其应用--(原卷版+解析).docx VIP
原创力文档

文档评论(0)