摘要: 1 #include <cstring> 2 #include <list> 3 #include <vector> 4 #include <cstdio> 5 using namespace std; 6 7 //后缀树中的结点类 8 struct SfxNode 9 { 10 const cha 阅读全文
posted @ 2022-03-11 00:00 互联星空 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 1 // Boruvka's algorithm to find Minimum Spanning 2 // Tree of a given connected, undirected and 3 // weighted graph 4 #include <stdio.h> 5 6 // a str 阅读全文
posted @ 2021-08-29 03:16 互联星空 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 1 // C program for Kruskal's algorithm to find Minimum 2 // Spanning Tree of a given connected, undirected and 3 // weighted graph 4 #include <stdio.h 阅读全文
posted @ 2021-08-29 03:11 互联星空 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 1 // A C program for Prim's Minimum 2 // Spanning Tree (MST) algorithm. The program is 3 // for adjacency matrix representation of the graph 4 #includ 阅读全文
posted @ 2021-08-29 03:00 互联星空 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 1 // A C++ program to print topological 2 // sorting of a DAG 3 #include <iostream> 4 #include <list> 5 #include <stack> 6 using namespace std; 7 8 // 阅读全文
posted @ 2021-08-29 01:52 互联星空 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 1 // C program to demonstrate Basic Euclidean Algorithm 2 #include <stdio.h> 3 4 // Function to return gcd of a and b 5 int gcd(int a, int b) 6 { 7 if 阅读全文
posted @ 2021-07-30 17:08 互联星空 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 归并排序 文本文件 sort1.txt 的内容如下: 1456 文本文件 sort2.txt 的内容如下: 2378 是用归并排序将上述两文件归并输出到文件 result.txt 1 #include <stdio.h> 2 #define LEN 4 3 4 void merge(FILE* me 阅读全文
posted @ 2021-01-04 18:13 互联星空 阅读(386) 评论(0) 推荐(0) 编辑
摘要: 冒泡排序 1 #include <stdio.h> 2 #include <string.h> 3 #define MAX 20 4 5 void bubble(char *string,int count) 6 { 7 int i,j; 8 char temp; 9 for(j = count;j 阅读全文
posted @ 2021-01-04 14:48 互联星空 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 顺序查找 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 5 #define MAX 100 6 7 struct element 8 { 9 int key; 10 }; 11 12 typedef struct e 阅读全文
posted @ 2021-01-03 18:01 互联星空 阅读(424) 评论(0) 推荐(0) 编辑
摘要: 生命游戏 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 #include <conio.h> 5 6 #define ROWLEN 10 7 #define COLLEN 10 8 #define DEAD 10 9 阅读全文
posted @ 2021-01-03 15:06 互联星空 阅读(614) 评论(0) 推荐(0) 编辑