
数据结构作业
ZAX1
这个作者很懒,什么都没留下…
展开
-
用栈解决迷宫问题(输出所有路径和最短路径)
#include<iostream>#include<cstdio>using namespace std;#define M 4 //行数#define N 4 //列数#define MaxSize 100 //栈最多元素个数int mg[M+2][N+2]= { {1,1,1,1,1,1} ,{1,0,0,0,1...原创 2018-11-01 20:18:45 · 6501 阅读 · 3 评论 -
从字符串恢复IP地址C++递归实现。
题目:给一个由数字组成的字符串。求出其可能恢复为的所有IP地址。如:给出字符串 "25525511135",所有可能的IP地址有两种: "255.255.11.135","255.255.111.35"(顺序无关紧要)代码:#include <iostream>#include <vector>#include <fstream>..原创 2018-11-18 21:17:55 · 929 阅读 · 0 评论 -
图的最小生成树prime算法【数据结构上机】
#include<iostream>#include<cstdio>#define MAXV 20 //最多顶点数#define INF 32767 //INF表示∞using namespace std;int sum=0;//typedef struct//{// int num; //顶点编号//} VertexType...原创 2018-12-04 18:11:48 · 494 阅读 · 0 评论 -
图的最小生成树kruskal算法【数据结构上机】
#include<iostream>#include<cstdio>#include <algorithm>#define MaxSize 100#define INF 32767 //INF表示∞#define MAXV 100 //最大顶点个数using namespace std;typedef int InfoType;int sum=...原创 2018-12-04 18:14:12 · 260 阅读 · 0 评论 -
数据结构课程设计作业 哈夫曼编码/译码器
#include<iostream>#include<algorithm>#include<cstdio>#include<cstring>#include<cstdlib>using namespace std;typedef struct{ char letter, *code; int weigh...原创 2019-02-01 22:36:32 · 6201 阅读 · 2 评论