- 博客(5)
- 收藏
- 关注
原创 快速排序
快速排序 经典算法 也没什么好多说的 时间复杂度:O(nlogn)———最坏情况下是O(n^2) 空间复杂度:O(logn)———-最坏情况下是O(n)这里测试数组a[]={1,3,5,7,2,4,6,8}#include<iostream> using namespace std; int partition(int R[],int low,int high) { int i,j,k
2015-08-22 20:51:01 581
原创 归并排序
这个没什么好说的,就是归并排序; 时间复杂度O(nlogn) 空间复杂度O(n)#include<iostream> using namespace std; void merge(int A[],int low,int middle,int high) { int i,j,k; int *B=new int [high-low+1]; i=low; k=low;
2015-08-22 11:38:54 525
原创 循环赛日程表-附数组指针与二级指针关系详解
循环赛日程表,在这篇文章已经说的很详细了http://blog.csdn.net/liufeng_king/article/details/8488421 这里多介绍一个细节,并详细解释数组指针#include<iostream> #include<stdio.h> using namespace std; void Round_Robin_Calendar(int **a,int k,int n
2015-08-20 22:18:10 496
原创 Kruskal算法-图由邻接表实现
#include<iostream> #define Vnum 10 #define MAX 10000 #include<string.h> #include<algorithm> using namespace std; typedef char Datatype; typedef struct arcnode { int adjvex; int weight; stru
2015-08-17 22:03:48 3398
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人