File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77
88/**
9- * 选择排序 http://zh.wikipedia.org/wiki/选择排序
10- * 原理:在未排序的序列中找到最大(小)的元素与第1个元素交换,
11- * 在剩余元素中继续找最大(小)的元素与第2个元素交换,
12- * 以此类推,直到排序完毕
13- */
9+ * @选择排序 http://en.wikipedia.org/wiki/Selection_sort
10+ *
11+ * 原理:在未排序的序列中找到最大(小)的元素与第1个元素交换,
12+ * 在剩余元素中继续找最大(小)的元素与第2个元素交换,
13+ * 以此类推,直到排序完毕
14+ */
1415
1516function selectionSort ( arr ) {
1617 var
@@ -42,9 +43,9 @@ function selectionSort(arr){
4243
4344
4445/**
45- *冒泡排序 http://en.wikipedia.org/wiki/Bubble_sort
46- *原理:两两比较顺序,如果顺序错误则交换位置
46+ *@冒泡排序 http://en.wikipedia.org/wiki/Bubble_sort
4747 *
48+ *原理:两两比较顺序,如果顺序错误则交换位置
4849 */
4950
5051function bubbleSort ( arr ) {
@@ -67,7 +68,7 @@ function bubbleSort(arr){
6768
6869
6970/**
70- *插入排序 http://en.wikipedia.org/wiki/Insertion_sort
71+ *@ 插入排序 http://en.wikipedia.org/wiki/Insertion_sort
7172 *
7273 *原理:1.从第二位(当前元素)开始从后向前查找
7374 * 2.若新元素(当前元素的前面)大于当前元素,将新元素移到下一位置
@@ -97,3 +98,13 @@ function insertionSort(arr){
9798
9899 return arr ;
99100}
101+
102+ /**
103+ * @二分插入排序
104+ * 用二分法对插入排序进行优化
105+ *
106+ */
107+
108+ function binaryInsertSort ( arr ) {
109+
110+ }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments