
数据结构学习
文章平均质量分 64
ACM2272902662
这个作者很懒,什么都没留下…
展开
-
数据结构 矩阵的快速转置 矩阵相乘(行逻辑连接顺序表)
快速转置 #include #include using namespace std; class num { public: int x,y; int e; int row,col; }a[100000],b[100000]; int sum[100000],deal[1000000]; int main() { int i,j,n,m,s,t,fl原创 2012-10-19 00:50:37 · 3795 阅读 · 3 评论 -
数据结构实验之栈二:一般算术表达式转换成后缀式
数据结构实验之栈二:一般算术表达式转换成后缀式 Time Limit: 1000MS Memory limit: 65536K 题目描述 对于一个基于二元运算符的算术表达式,转换为对应的后缀式,并输出之。 输入 输入一个算术表达式,以‘#’字符作为结束标志。 输出 输出该表达式转换所得到的后缀式。 示例输入 a*b+(c-d/e)*f# 示例输出原创 2012-11-07 20:02:18 · 1615 阅读 · 0 评论 -
数据结构 二叉树 索引链表 及其索引话 输出
#include #include using namespace std; class tree { public: char c; tree *lchild,*rchild; int ltag,rtag; }; char c; tree *pre; int main() { void build(tree * &p); void inthread(t原创 2012-11-09 09:42:35 · 1189 阅读 · 0 评论 -
数据结构 二叉树的建立 与各种遍历
#include #include using namespace std; class tree { public: char c; tree* rchild,*lchild; }; char c; int main() { void build(tree *&p); void Preorder(tree *p);原创 2012-11-08 21:39:29 · 1002 阅读 · 0 评论 -
数据结构 广义表的建立与求深度
今天心血来潮想写一下广义表的建立与求深度,但是却写的很纠结 ,调试了很长时间,千万别随便乱用全局变量,否则在递归的时候会改变上一层同变量的值,这样的话查很长时间也检查不出来。 #include #include using namespace std; string s1,s2; char s3[10000]; class num { public: i原创 2012-11-11 16:09:41 · 1328 阅读 · 0 评论 -
数据结构 前序遍历结果 中序遍历结果确定二叉树
在写的时候,突然想到 如果二叉树中有相同的字母 ,那么根据前序遍历与中序遍历的结果确定的二叉树可能会出错比如 前序遍历的结果为a a a,中序遍历的结果也为a a a,则对于这种情况建的二叉树可能不一样,但同样满足要求, 下面的程序是在二叉树中没有相同的字母出现,从而能唯一确定二叉树 // 树中各字符均不相同,否则有可能建的数不唯一 #include #include using n原创 2012-11-11 18:05:19 · 1384 阅读 · 0 评论