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
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
- 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的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 20182320《Program Design and Data Structures》Learning Summary Week9
20182320<Program Design and Data Structures>Learning Summary Week9 1.Summary of Textbook's Con ...
- 【Python学习笔记】Coursera课程《Python Data Structures》 密歇根大学 Charles Severance——Week6 Tuple课堂笔记
Coursera课程<Python Data Structures> 密歇根大学 Charles Severance Week6 Tuple 10 Tuples 10.1 Tuples A ...
随机推荐
- 【vue】vue生命周期解读 (流程+钩子函数)
参考详细说明一波简书 (vue中钩子函数解读) 1.实例渲染流程 2.生命周期钩子函数比 钩子函数详解简书一 钩子函数详解简书二
- 【nodeJs】nodejs
node.js
- #leetcode刷题之路42-接雨水
给定 n 个非负整数表示每个宽度为 1 的柱子的高度图,计算按此排列的柱子,下雨之后能接多少雨水.上面是由数组 [0,1,0,2,1,0,1,3,2,1,2,1] 表示的高度图,在这种情况下,可以接 ...
- swoft orm中的坑(针对实体类的属性名称和数据库字段不相等)
最近在用swoft的orm,发现了一些问题: 首先看下实体类的定义 它的属性名称和所映射的数据库字段名不一致,这个就会导致蛋疼的问题,首先,在我们使用orm的时候,应该使用哪个字段? 我直接说结论,在 ...
- linux文件属性介绍
Linux系统有如表所示的几种文件类型. 使用ls -lih 命令就可以看到各个文件的具体信息,下面选取以上所提到的这几种文件,列出他们的信息. 除了设备文件(包括字符设备文件和块设备文件二种)外,每 ...
- HDU 6191 2017ACM/ICPC广西邀请赛 J Query on A Tree 可持久化01字典树+dfs序
题意 给一颗\(n\)个节点的带点权的树,以\(1\)为根节点,\(q\)次询问,每次询问给出2个数\(u\),\(x\),求\(u\)的子树中的点上的值与\(x\)异或的值最大为多少 分析 先dfs ...
- 如何优化mysql查询速度
1.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表扫描. 2.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉 ...
- 网络编程的演进——从Apache到Nginx
Apache 1.Apache HTTP服务器是 Robert McCool 在1995年写成,并在1999年开始在Apache软件基金会的 框架下进行开发. 由于Apache HTTP服务器是基金会 ...
- 【日常训练】Help Victoria the Wise(Codeforces 99C)
题意与分析 这题意思是这样的:在正方体的六面镶嵌给定颜色的宝石(相同颜色不区分),然后问最多有几种彼此不等价(即各种旋转过后看起来一致)的方案. 其实可以乱搞,因为范围只有720.求出全排列,然后每个 ...
- Maven仓库 - 分发构件至远程仓库
分发构件至远程仓库 mvn install 会将项目生成的构件安装到本地Maven仓库,mvn deploy 用来将项目生成的构件分发到远程Maven仓库.本地Maven仓库的构件只能供当前用户使 ...