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 ...
随机推荐
- 升序排列的数组中是否存在A[i]=i
#include<stdio.h> void equal(int a[],int N) { int i; ;i<N;i++) { if(i<a[i]) { printf(&qu ...
- 1.1《想成为黑客,不知道这些命令行可不行》(Learn Enough Command Line to Be Dangerous)——运行终端
终端是个允许我们运行命令行的程序,运行命令前,先打开它.在MacOS系统上,可以使用macOS应用 Spotlight来打开终端窗口,Spotlight也有其他两种方式触发,一种是键入⌘␣(comma ...
- jQuery学习- 位置选择器
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- [并发并行]_[线程模型]_[Pthread线程使用模型之三 客户端/服务端模型(Client/Server]
Pthread线程使用模型之三 客户端/服务端模型(Client/Server) 场景 1.在客户端/服务端模型时,客户端向服务端请求一些数据集的操作. 服务端执行执行操作独立的(多进程或跨网络)– ...
- 09 ORM 多表操作,创建表,添加记录
1.数据库表关系 1.一对多 为什么需要,重复字段太多 一对多关系表 Book id title price publish_id 1 python 100 1 2 php 200 2 3 go 10 ...
- 2-功能1:基于用户认证组件和Ajax实现登录验证(图片验证码)
1.登录页面的设计 (1)label标签的id属性 label标签的id属性,点击label标记,相当于点击了input框 bootstarp样式 class="form-group&quo ...
- 3、顺序表、内存、类型、python中的list
1.内存.类型本质.连续存储 1.内存本质 2.C 语言实例-计算 int, float, double 和 char 字节大小 使用 sizeof 操作符计算int, float, double 和 ...
- SQL Server 中SELECT INTO 和 INSERT INTO SELECT 两种表复制语句
1.INSERT INTO SELECT语句 语句形式为:Insert into Table2(field1,field2,...) select value1,value2,... from Tab ...
- c#总结:datatable的方法大全
最近在做一个数据处理,保存到datatable中,在过程中了解了datatable一些用法,总结一下: //定义 DataTable dt = new DataTable(); //写入列名: htT ...
- 解决公司的垃圾wifi dhcp获取不到ip 以及配上ip也不能联网的原因
用手机连公司的wifi时,发现dhcp自动获取不到ip,然后配置了静态ip,但是还是无法联网, 然后发现鸡巴垃圾公司傻逼操她妈的逼原来是google的dns导致不能用??? 换成114.114.11 ...