20162314 2017-2018-1 《Program Design & Data Structures》Learning Summary Of The Ninth Week

Summary of Key Concepts

  • A heap is a complete binary tree in which each element is greater than or equal to both of its children.

  • Adding an element to a heap can be accomplished by adding the element as a leaf, then moving it upward as appropriate.

  • Removing the maximum element from the heap can be accomplished by replacing the root with the last leaf, then moving it downward as appropriate.

  • A heap sort makes use of the primary characteristic of a heap to sort a set of elements.

  • A priority queue is not a FIFO queue. It orders elements according to priority,independent of the order in which they are added to the queue.

Problem and solution in teaching materials.

What is the difference between a heap and a binary search tree?

  • A binary search tree and a heap are both binary trees that have constraints on the relationships among their elements. The nodes in a binary search tree are less than their left child and
  • greater than or equal to their right child, whereas the nodes in a heap (maxheap) are greater than or equal to both children.

What is the difference between a minheap and a maxheap?

  • A minheap keeps the smallest value in the tree at the root,whereas a maxheap keeps the largest value at the root.
  • Otherwise, their strategies and implementations are similar.

How is the largest element removed from a heap?

  • The maximum element is removed from a heap (maxheap) by replacing the root with the last leaf of the tree, then moving that
  • element down the tree as appropriate to reassert the proper relationships among the elements.

Code hosting

Summary of error for last week.

Linear search is always more effective than binary search.The answer should be false, for the situation of "n = 2".

Evaluate for my partner

  • Advantage and problem in the blog:

    • Concise and comprehensie
    • Uncleary to the content
    • Mould is amazing
  • Advantage and problem in the code:
    • Serious writing.
    • Wonderful idea
    • Too less

Learning situation of partner

  • 20162310

  • Learning content of partner:
    • Algorithm
    • Recursion
    • HanoiTowers and maze

Anything else that want to say

  • It's not easy to persere on utizing English to write a blog.But I'm getting used to doing this because of the benefit.

Academic progress check

Code line number(increasing/accumulative) Blog number(inc/acc) studying time(inc/acc) progress
target 5000lines 30articles 400hours
First week 180/180 1/1 20/20
Second week 1049/1229 1/2 18/38
Third week 1037/2266 3/7 22/60
Fourth week 1120/3386 2/9 30/90

20162314 《Program Design & Data Structures》Learning Summary Of The Ninth Week的更多相关文章

  1. 20162314 《Program Design & Data Structures》Learning Summary Of The Seventh Week

    20162314 2017-2018-1 <Program Design & Data Structures>Learning Summary Of The Seventh Wee ...

  2. 20162314 《Program Design & Data Structures》Learning Summary Of The Fifth Week

    20162314 2017-2018-1 <Program Design & Data Structures>Learning Summary Of The Fifth Week ...

  3. 20162314 《Program Design & Data Structures》Learning Summary Of The Second Week

    20162314 2017-2018-1 <Program Design & Data Structures>Learning Summary Of The Second Week ...

  4. 20162314 《Program Design & Data Structures》Learning Summary Of The First Week

    20162314 2017-2018-1 <Program Design & Data Structures>Learning Summary Of The First Week ...

  5. 20162314 《Program Design & Data Structures》Learning Summary Of The Eleventh Week

    20162314 2017-2018-1 <Program Design & Data Structures>Learning Summary Of The Eleventh We ...

  6. 20162314 《Program Design & Data Structures》Learning Summary Of The Tenth Week

    20162314 2017-2018-1 <Program Design & Data Structures>Learning Summary Of The Tenth Week ...

  7. 20162314 《Program Design & Data Structures》Learning Summary Of The Eighth Week

    20162314 2017-2018-1 <Program Design & Data Structures>Learning Summary Of The Eighth Week ...

  8. 20182320《Program Design and Data Structures》Learning Summary Week9

    20182320<Program Design and Data Structures>Learning Summary Week9 1.Summary of Textbook's Con ...

  9. 【Python学习笔记】Coursera课程《Python Data Structures》 密歇根大学 Charles Severance——Week6 Tuple课堂笔记

    Coursera课程<Python Data Structures> 密歇根大学 Charles Severance Week6 Tuple 10 Tuples 10.1 Tuples A ...

随机推荐

  1. 用kubeadm 搭建 高可用集群问题记录和复盘整个过程 - 通过journalctl -u kubelet.service命令来查看kubelet服务的日志

    1.根据  https://github.com/cookeem/kubeadm-ha/blob/master/README_CN.md  去搭建ha集群,遇到几个问题: runtime networ ...

  2. KVM的初始化过程

    之前打算整理一下在Guest VM, KVM, QEMU中IO处理的整个流程,通过查阅资料和阅读源码,已经大致知道IO在Guest KVM中的处理流程.当想要整理IO在KVM和QEMU中的处理时,发现 ...

  3. PHP核心技术——面向对象

    类与对象: 类的定义与实例化. //定义类 class person{ public $name; public $gender; public function say(){ echo $this- ...

  4. c#操作注册表的意外

    因为要在C/S程序中使用WebBrowser控件,因为默认的IE版本很低,无法使用Html5功能,故需通过把程序名写入注册表的方法指定IE版本. 但操作的过程中出现一个问题: 1.使用代码找到相关项, ...

  5. UWP Read write File -StorageFile

    // private void MainPage_Loaded(object sender, RoutedEventArgs e) { GetFileAsync(); } public async v ...

  6. IPC学习

    课下作业-IPC 要求: 研究Linux下IPC机制:原理,优缺点,每种机制至少给一个示例,提交研究博客的链接 共享内存 管道 FIFO 信号 消息队列 共享内存 共享内存可以说是最有用的进程间通信方 ...

  7. OSG环境变量设置

    osg中需要设置一些环境变量设置,如 OSG_FILE_PATH:此变量设置模型数据的目录 OSG_SCREEN: 此变量设置显示模型是在单屏幕还是多屏幕,1为单屏幕 OSG_WINDOW: 此变量设 ...

  8. django学习笔记(2)

    Part 2: The admin site ====> Creating an admin user$ python manage.py createsuperuser   Username: ...

  9. 【SDOI2011】工作安排

    题面 题解 如果没有分段函数的限制的话就很好做了 但是我们发现分段函数的段很少,我们就可以将每一段拆开, 强制限制一定流量就可以了 代码 #include<cstdio> #include ...

  10. cogs1799 [国家集训队2012]tree(伍一鸣)

    LCT裸题 注意打标记之间的影响就是了 这个膜数不会爆unsigned int #include<cstdio> #include<cstdlib> #include<a ...