摘要: #include #include using namespace std; #define MAX 1000000 struct Node{ int data; Node* next; }; void output(Node* head){ if(!head->next && !head->data) return; output(head->next);... 阅读全文
posted @ 2016-09-04 14:36 绿水白川 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 时间复杂度: 冒泡、选择、插入排序:O(n2) 快速、归并、堆排序:O(nlog2n) 希尔排序:O(n1+ξ) 0<ξ<1 阅读全文
posted @ 2016-09-04 14:10 绿水白川 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; void Cocktail(int *arr, int size){ int tail = size - 1; for(int i = 0; i i; j--){ if(arr[j] arr[j+1]){ int temp = arr[j]; ... 阅读全文
posted @ 2016-09-04 11:26 绿水白川 阅读(197) 评论(0) 推荐(0) 编辑