|
@@ -594,24 +594,122 @@ RESPONSE:
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+### (3)postman实例测试
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
## 4.插入排序
|
|
## 4.插入排序
|
|
|
|
|
|
|
|
### (1)符号说明
|
|
### (1)符号说明
|
|
|
|
|
|
|
|
1.颜色和意义
|
|
1.颜色和意义
|
|
|
|
|
|
|
|
|
|
+blue: 未被选中,还未排好序
|
|
|
|
|
+
|
|
|
|
|
+green: 在比较当中或在移动当中(在移动当中显示移动后的位置)
|
|
|
|
|
+
|
|
|
|
|
+red: 当前需要插入的值
|
|
|
|
|
|
|
|
|
|
+orange: 已排好序
|
|
|
|
|
+
|
|
|
|
|
+white: 空白bar (空白bar的color为white, value为0)
|
|
|
|
|
|
|
|
2.状态和意义
|
|
2.状态和意义
|
|
|
|
|
|
|
|
|
|
+onSelect: 已选中下一个待插入目标,待插入目标已出列,但还未开始比较
|
|
|
|
|
+
|
|
|
|
|
+onCompare: 正在比较
|
|
|
|
|
+
|
|
|
|
|
+onExchange: 比较后发现逆序,与空白bar交换位置
|
|
|
|
|
+
|
|
|
|
|
+onInsertion: 比较和交换后发现此时空白bar就是应该把当前值插入的地方,显示插入后的结果(所有bar只有blue和orange两种颜色)
|
|
|
|
|
+
|
|
|
|
|
+allSorted: 所有的值都已排好序(全部为蓝色)
|
|
|
|
|
+
|
|
|
### (2)接口返回值格式(只含response的content部分,实际的json还包含外面的response其他部分)
|
|
### (2)接口返回值格式(只含response的content部分,实际的json还包含外面的response其他部分)
|
|
|
|
|
|
|
|
|
|
+{
|
|
|
|
|
+
|
|
|
|
|
+ initial:
|
|
|
|
|
+
|
|
|
|
|
+ [{value: ,color: },{value: ,color: },{value: ,color: },...]
|
|
|
|
|
+
|
|
|
|
|
+ onSortingSates:
|
|
|
|
|
+
|
|
|
|
|
+ [
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ type:
|
|
|
|
|
+
|
|
|
|
|
+ insertionIndex: //空白bar所在的位置,从0开始。也是red bar的index。只有type为onSelect, onCompare, onExchange,时,
|
|
|
|
|
+
|
|
|
|
|
+ content: [{value: ,color: },{value: ,color: },{value: ,color: },...] //insertionIndex才有意义,onInsertion状态没有空白bar
|
|
|
|
|
+
|
|
|
|
|
+ }, //因此,onInsertion状态的insertionIndex为该值插入的下标。
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ type:
|
|
|
|
|
+
|
|
|
|
|
+ insertionIndex:
|
|
|
|
|
+
|
|
|
|
|
+ content: [{value: ,color: },{value: ,color: },{value: ,color: },...]
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ type:
|
|
|
|
|
+
|
|
|
|
|
+ insertionIndex:
|
|
|
|
|
+
|
|
|
|
|
+ content: [{value: ,color: },{value: ,color: },{value: ,color: },...]
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ ...
|
|
|
|
|
+
|
|
|
|
|
+ ]
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+### (3)postman实例测试
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
## 5.快速排序
|
|
## 5.快速排序
|
|
|
|
|
|
|
|
### (1)符号说明
|
|
### (1)符号说明
|
|
|
|
|
|
|
|
1.颜色和意义
|
|
1.颜色和意义
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
2.状态和意义
|
|
2.状态和意义
|
|
|
|
|
|
|
|
-### (2)接口返回值格式(只含response的content部分,实际的json还包含外面的response其他部分)
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+### (2)接口返回值格式(只含response的content部分,实际的json还包含外面的response其他部分)
|
|
|
|
|
+
|
|
|
|
|
+### (3)postman实例测试
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+## 6.图
|
|
|
|
|
+
|
|
|
|
|
+### (1)符号说明
|
|
|
|
|
+
|
|
|
|
|
+1.颜色和意义
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+2.状态和意义
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+### (2)接口返回值格式(只含response的content部分,实际的json还包含外面的response其他部分)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+### (3)postman实例测试
|