04 2015 档案
摘要:package com.baobaotao.ditype;import java.util.Iterator;import java.util.List;import java.util.Map;import org.springframework.context.support.ClassPath...
阅读全文
摘要:#includeusing namespace std;typedef struct Node{ Node* left; Node* right; Node* p; int data; Node(){} Node(int dat) :data(dat){ left...
阅读全文
摘要:陕西日报社新闻采编系统的设计与实现刘海2014年12月中图分类号:TP311.UDC分类号:004.陕西日报社新闻采编系统的设计与实现 作 者 姓 名 刘海 学 院 名 称 软件学院 指 导 教 师 金乾坤 答辩委员会主席 教授 申 请 学 位 工程硕士 学 科 专 业 软件工程...
阅读全文
摘要:#include#include#include#include#includeusing namespace std;//求最大公约数int gcd(int a, int b){ if (b == 0) return a; return gcd(b,a%b);}//---...
阅读全文
摘要:#include#includeusing namespace std;void Print_LCS(int **b, string X,int m, int n);void LCS_Length(string X, string Y){ int m = X.length(); int ...
阅读全文
摘要://全排列问题void Perm(string list, int i){ if (i == list.length()) { for (int c = 0; c < list.length(); c++) { cout << list....
阅读全文
摘要:#include#includeusing namespace std;//rn=max(pi+rn-1)int Cut_Rod(int *p, int n){ if (n == 0) return 0; int q = -1; for (int i = 1; i =...
阅读全文
摘要:#include#include#include #include #include using namespace std;//朴素模式匹配void Naive_String_Matcher(string T, string P){ int n = T.length(); int m ...
阅读全文
摘要:#includeusing namespace std;class Queue{ int data[10]; int head; int tail;public: Queue(); void Enqueue(int dat); int Dequque();};Qu...
阅读全文
摘要:#includeusing namespace std;class Stack{ int top; int data[10];public: Stack(); bool empty(); void push(int dat); int pop();};Stack:...
阅读全文
摘要:void Swap(int *a, int *b) { int c = *a; *a = *b; *b = c; }
阅读全文
摘要:#includeusing namespace std;void SelectSort(int *A, int len){ for (int i = 0; i = 0 && A[j]>tmp; j--) A[j + 1] = A[j]; A[...
阅读全文
摘要:#include#includeusing namespace std;int Partition(int *A, int p, int r)// 划分{ int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { ...
阅读全文
摘要:int Random5(){ return rand() % 5 + 1;}int Random7(){ return rand() % 7 + 1;}int rand7(){ int i; do { i = 5 * (Random5() - 1) + R...
阅读全文
摘要:#include#includeusing namespace std;int Partition(int *A, int p, int r){ int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { ...
阅读全文
摘要:#includeusing namespace std;int Partition(int *a, int p, int r){ int i = p - 1; int x = a[r]; for (int j = p; j < r; j++) { ...
阅读全文
摘要:#define swap(a,b) (a)=(a)^(b);(b)=(a)^(b);(a)=(a)^(b)这种方法,不能用于同址交换,如a=A[0],b=A[0];原因很简单,因为修改一个就会修改另外一个,它修改的地址里对应的数的值
阅读全文
摘要:首先两两比较找到最大的元素,需要n-1次,即二叉树的非叶子节点的个数。之后次最大的一定在和最大的元素比较过的元素中,共有lgn-1个,即树的高度。故加起来就是n+lgn-2#includeusing namespace std;class Node{public: Node(); Nod...
阅读全文
摘要:#includeusing namespace std;void getMaxMin(int a[], int len){ int max, min; if (len % 2) { max = min = a[0]; for (int i = 1; i ...
阅读全文
摘要:1 #include 2 #include 3 using namespace std; 4 //数值型基数排序 5 int getDigit(int num, int index) 6 { 7 int mod = 1; 8 while (index) 9 ...
阅读全文