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

Summary of teaching materials

  • Searching is the process of finding a designated target within a group of items or determining that it doesn’t exist.

  • An efficient search minimizes the number of comparisons made.

  • A binary search capitalizes on the fact that the search pool is sorted.

  • The Comparable interface allows an algorithm to be implemented polymorphically, without regard to a particular class.

  • A binary search capitalizes on the fact that the search pool is sorted.

  • A binary search eliminates half of the viable candidates with each comparison.

  • Sorting is the process of arranging a list of items into a defined order based on some criteria.

  • The selection sort algorithm sorts a list of values by repeatedly putting a particular value into its final, sorted position.

  • The insertion sort algorithm sorts a list of values by repetitively inserting a particular value into a subset of the list that has already been sorted.

  • The bubble sort algorithm sorts a list by repeatedly comparing neighboring elements and swapping them if necessary.

  • The quick sort algorithm sorts a list by partitioning the list and then recursively sorting the two partitions.

  • The merge sort algorithm sorts a list by recursively dividing the list in half until each sublist has one element and then merging these sublists into the sorted order.

  • A binary search has logarithmic complexity, making it very efficient for a large search pool.

  • The average running time complexity for selection sort, insertion sort, and bubble sort is O(n 2 ).

  • The key to quick sort is picking a good partition element.

  • Merge sort has a maximum running time complexity of O(n log n).

Problem and solution in learning materials of teaching.

Which of linear search and binary search is faster ? And why ?

To start with,A binary search capitalizes on the fact that the search pool is sorted.At the same time,a binary search eliminates half of the viable candidates with each comparison.

Therefore,In general, a binary search is more efficient than a linear search because it eliminates many candidates with each comparison.

What is the difference between merge sort and selection sort ? In addition,there are insertion sort, and bubble sort.

Although selection sort, insertion sort, and bubble sort each solve the problem with a different technique, they all do so with approximately the same efficiency.
All three of those algorithms use two loops, one nested within the other, toarrange the elements in order, and the details all lead to an O(n 2 ) running time.
The analysis of merge sort is similar to that of quick sort, except that we are guaranteed that the recursive decomposition for merge sort will always divide the
data in half.Therefore, the effort of merge sort is O(n log n) in the best, worst, and average cases.

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 2049/2229 1/2 18/38
Third week 500/1000 3/7 22/60
Fourth week 300/1300 2/9 30/90

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

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

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

  2. 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 ...

  3. 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 ...

  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. kubernetes 网络模型

    在Kubernetes模型中,每个Docker主机的docker0网桥都是可以路由的. 那就是说,当一个Pod部署后,集群其他主机能够不在物理主机上做端口映射就可以直接访问Pod. 有了这种说法,从网 ...

  2. 考虑写一个不抛出异常的swap函数

    我们可以调用std下的swap函数,这是一个模板函数:既可以: ; ; std::swap(a,b); cout<<"a = "<<a<<&qu ...

  3. Centos 模拟生成文件的脚本

    #!/bin/sh count= #控制每秒写入不同大小的文件 while true do ;i<=$count;i++)) do /bin/-`.jpg done ;i<=$count; ...

  4. 深入理解PHP 数组之count 函数

    count()PHP count() 函数用于计算数组中的单元数目或对象中的属性个数,返回数组的单元个数或对象中的属性个数.语法:int count( mixed var [, int mode] ) ...

  5. uboot-2012.04.01移植编译前准备

    一:准备移植1.从下面的官网下载uboot-2012.04.012.建立sourceinsight工程 a.解压并在E:\colin weidongshan\transplant_u-boot-201 ...

  6. mfc 形式参数初始化

    初始化函数形参 int add(int a,int b) { return a+b; } add(,); ,,char*s=NULL) { printf("a=%d,b=%d,c=%d\n& ...

  7. python+soket实现 TCP 协议的客户/服务端中文(自动回复)聊天程序

    [吐槽] 网上的代码害死人,看着都写的言之凿凿,可运行就是有问题. 有些爱好代码.喜欢收藏代码的朋友,看到别人的代码就粘贴复制过来.可是起码你也试试运行看啊大哥 [正文] 昨日修改运行了UDP协议的C ...

  8. 2_C语言中的数据类型 (六)浮点数

    1.1       浮点float,double,long double类型 1.1.1          浮点常量,变量 Float在32位系统下是4个字节,double在32位系统下是8个字节 小 ...

  9. cogs 421 [SDOI2009]HH的项链

    主席树.比树状数组高端多了又好写. last[i]表示上一个颜色为i的数,没有则为0. 那么一个区间里的答案就显而易见了: \(\sum_{i=l}^r (last[i]<l)\) 上面的东西已 ...

  10. ssm 配置事务回滚

    参考:https://blog.csdn.net/Mint6/article/details/78363761 在 applicationContext.xml 中配置好了事务和数据源等必须要用到的配 ...