摘要: 1.实现Servlet接口的方式 2.通过继承GenericServlet 3.通过继承HttpServlet 阅读全文
posted @ 2018-07-12 10:07 蝉鸣的Summer 阅读(363) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; //欧几里德算法求两个非负整数的最大公约数 int getDivisor(int a,int b) { int max,min; max = a; min = b; //两数中大数模小数,若结果不为0,则舍弃大数 ,把小数和模运算的结果分出大小来,继续取模运算 //依次递归求解,直到模运算结果... 阅读全文
posted @ 2018-05-10 21:47 蝉鸣的Summer 阅读(950) 评论(0) 推荐(0) 编辑
摘要: #define MAXSIZE 8 //邻接表结构 typedef struct ArcNode{ int adjvex; //该边所指向的结点编号 struct ArcNode *nextarc; //指向下一条边的指针 int info; //该边的相关信息,权值等 }ArcNode; typedef struct{ ... 阅读全文
posted @ 2018-04-25 14:55 蝉鸣的Summer 阅读(1561) 评论(0) 推荐(0) 编辑
摘要: int GetNumInPos(int value,int pos); int GetMaxPos(int a[],int n); void RadixSort(int a[],int left,int right); //获得整数value从低位到高位的第pos(1-->)位数值 int GetNumInPos(int value,int pos) { int i; int ... 阅读全文
posted @ 2018-04-17 22:06 蝉鸣的Summer 阅读(918) 评论(0) 推荐(0) 编辑
摘要: void Merge(int a[],int low,int mid,int high); void MergeSort(int a[],int low,int high); //将两个非降序序列low--mid,mid+1--high合并为一个新的非降序序列 void Merge(int a[],int low,int mid,int high) { int len = high-l... 阅读全文
posted @ 2018-04-17 21:45 蝉鸣的Summer 阅读(2377) 评论(0) 推荐(0) 编辑
摘要: void QuickSort(int a[],int low,int high); //对a[low]到a[high]由小到大排序 void QuickSort(int a[],int low,int high) { int pivot; int i=low,j=high; if(low=pivot) //从右往左找到第一个小于枢轴的数 ... 阅读全文
posted @ 2018-04-17 21:36 蝉鸣的Summer 阅读(2867) 评论(0) 推荐(2) 编辑
摘要: void BubbleSort(int a[],int left,int right); //对a[left]到a[right]由小到大排序 void BubbleSort(int a[],int left,int right) { int i,j; int flag; //当一次循环中未发生交换,0标记排序结束 int temp; for(i=right;... 阅读全文
posted @ 2018-04-17 21:33 蝉鸣的Summer 阅读(227) 评论(0) 推荐(0) 编辑
摘要: void ShellSort(int a[],int left,int right); //对a[left]到a[right]从小到大排序 void ShellSort(int a[],int left,int right) { int len = right - left +1; int gap,i,j,temp; //Shell提出的增量选取规则n/2,n/4,..... 阅读全文
posted @ 2018-04-17 21:25 蝉鸣的Summer 阅读(182) 评论(0) 推荐(0) 编辑
摘要: void BinaryInsertionSort(int a[],int left,int right); //对数组a[left]到a[right]段数据从小到大排序 void BinaryInsertionSort(int a[],int left,int right) { int low,middle,high; int temp; int i,j; //... 阅读全文
posted @ 2018-04-17 21:19 蝉鸣的Summer 阅读(520) 评论(0) 推荐(0) 编辑
摘要: void InsertionSort(int a[],int len); /* 算法: */ //由小到大的直接插入排序 direct insertionsort void InsertionSort(int a[],int len) { int i,j; int temp; for(i=1;i=0&&tempa[n-1]},step{1,2,3,..... 阅读全文
posted @ 2018-04-17 21:06 蝉鸣的Summer 阅读(374) 评论(0) 推荐(0) 编辑