摘要: 二叉树二叉查找树(BST)笛卡尔树MVP树Top treeT树自平衡二叉查找树AA树AVL树左倾红黑树红黑树替罪羊树伸展树树堆节点大小平衡树B树B+树B*树Bx树UB树2-3树2-3-4树(a,b)-树Dancing treeH树Trie后缀树基数树三叉查找树X-快速前缀树Y-快速前缀树二叉空间分割(BSP)树四叉树八叉树k-d树隐式k-d树VP树非二叉树指数树融合树区间树PQ树Range treeSPQR树Van Emde Boas tree空间数据分割树R树R*树R+树X树M树线段树希尔伯特R树优先R树其他树堆散列日历散列树Finger treeOrder statistic treeMe 阅读全文
posted @ 2013-04-10 23:19 OpenSoucre 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <vector> 3 #include <cstdio> 4 #include <cstring> 5 #include <algorithm> 6 using namespace std; 7 8 int main(){ 9 vector<string> first,second;10 string a,b;11 bool exitFlag = false;12 while(1){13 getline(cin,a);14 if(a == "#&q 阅读全文
posted @ 2013-04-10 23:08 OpenSoucre 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 最长公共子序列的变形题,算法导论公共子序列后的练习题有题是类似的注意在公共子序列中要判断a[i]和b[j]相等,而此题是考虑相似,不要求相等 1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 #include <cstdio> 5 #include <cstring> 6 #include <string> 7 #include <map> 8 9 #define MAX 100 + 510 using namespace st 阅读全文
posted @ 2013-04-10 22:13 OpenSoucre 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 #include <string> 5 #define MAX 200 6 using namespace std; 7 8 struct stu{ 9 int id;10 string time;11 };12 13 bool cmp(stu a,stu b){14 return a.time<b.time;15 }16 17 int main(){18 int n;19 while(cin >> 阅读全文
posted @ 2013-04-10 17:22 OpenSoucre 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 转换成最大子序列和 1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 #include <cstring> 5 6 #define MAX 200 7 using namespace std; 8 9 int main(){10 int n;11 while(cin >>n){12 int arr[MAX][MAX]={0};13 for(int i = 1; i<= n; i ++ ){14 for(int j = 1; j <= n.. 阅读全文
posted @ 2013-04-10 16:48 OpenSoucre 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 #include <map> 5 #include <string> 6 7 using namespace std; 8 9 struct matrix{10 int row,col;11 };12 13 int main(){14 int n;15 cin >>n;16 map<string,matrix> a;17 for(int i = 0;i < n; i ++ 阅读全文
posted @ 2013-04-10 16:16 OpenSoucre 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 计算几何基础问题,具体可以参考算法导论p577,确定两个线段是否相交 1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 5 using namespace std; 6 7 struct point{ 8 double x,y; 9 };10 11 struct segment{12 point p1,p2;13 };14 15 double direction(point p1, point p2, point p3){16 return (p2.x-p1.x)*(p3.y 阅读全文
posted @ 2013-04-10 14:51 OpenSoucre 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 最长递增子序列 1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 #include <cstring> 5 #define MAX 1001 6 using namespace std; 7 8 int dp[MAX]; 9 10 int main(){11 int n;12 while(cin >> n && n){13 int player[MAX];14 for(int i = 1 ; i <= n ; i ++ ) cin 阅读全文
posted @ 2013-04-10 13:54 OpenSoucre 阅读(139) 评论(0) 推荐(0) 编辑