![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构实验
赛亚人_1
开通博客发表自己的一些编程代码以及学习的一些感受,希望各位朋友能给予我一些宝贵的建议。
展开
-
数据结构实验十一——树的基本操作
#include #include typedef struct BiNode { char data; struct BiNode *lchild,*rchild; }BiNode,*BiTree; void CreateTree(BiTree *T)//输入有技巧!! { char ch; scanf("%c",&ch); if(ch==' ')原创 2015-01-27 12:12:00 · 614 阅读 · 0 评论 -
数据结构实验七——循环队列
#include #include #define M 100 int flag=0; typedef struct SqQueue { char *base; int front; int rear; }SqQueue; void InitQueue(SqQueue *Q) { Q->base=(char *)malloc(M*sizeof(char));原创 2015-01-22 20:38:42 · 948 阅读 · 0 评论 -
数据结构实验六——链队列
#include #include int flag=0; typedef struct Qnode { char data; struct Qnode *next; }Qnode,*QnodePtr; typedef struct LinkQueue { QnodePtr front; QnodePtr rear; }LinkQueue; void InitQ原创 2015-01-21 23:43:56 · 569 阅读 · 0 评论 -
数据结构实验五——栈实现数制转换
#include #include #define N 10 #define M 5 typedef struct SeqStack { int stacksize; int *base; int *top; }SeqStack; void Initstack(SeqStack *S) { S->base=(int *)malloc(N*sizeof(int))原创 2015-01-20 22:09:25 · 1462 阅读 · 0 评论 -
数据结构实验四——链栈
#include #include int flag=0; typedef struct linknode { char data; struct linknode *next; }linknode; typedef struct LinkStack { linknode *top; }LinkStack; void InitStack(LinkStack *S) {原创 2015-01-19 23:57:25 · 481 阅读 · 0 评论 -
数据结构实验三——顺序栈
#include #include #define M 10 #define N 5 int flag=0; typedef struct SeqStack { char *top; char *base; int stacksize; }SeqStack; void InitStack(SeqStack *S) { S->base=(char *)malloc原创 2015-01-19 16:17:49 · 571 阅读 · 0 评论 -
数据结构实验2——链表
#include #include typedef struct LNode { char data; struct LNode *next; }LNode,*Linklist; int flag=0; void menu() { printf("\t链表的基本操作实验\t\t\n"); printf("****************************原创 2015-01-18 23:32:37 · 535 阅读 · 0 评论 -
数据结构实验1——顺序表
一千个读者心中就有一千个哈姆雷特。虽然我AC了这道题,但是代码还有很多不足之处,代码不简 洁、不高效等等。欢迎大家批评指正,给予宝贵的建议!同时期待大家给出高效简洁的代码,一边学 习交流!原创 2015-01-18 20:39:37 · 1031 阅读 · 0 评论 -
数据结构实验10——稀疏矩阵
#include #include #define Num 125 typedef struct Triple { int i,j; int e; }Triple; typedef struct TS { Triple data[Num]; int mu,nu,tu; }TS; void CreateTS(TS *M) { int s; prin原创 2015-01-27 10:17:28 · 751 阅读 · 0 评论 -
数据结构实验十——对称矩阵
#include #include #define M 10 #define N 4 int main() { int a[M]={1,2,3,4,5,6,7,8,9,10}; int b[M]={1,1,1,1,1,1,1,1,1,1}; int c[N][N],d[N][N]; int i,j,k=0,s; for(i=0;i<N;i++)原创 2015-01-26 21:31:15 · 616 阅读 · 0 评论 -
数据结构实验9——串
#include #include #define Num 255 typedef struct String { char ch[Num]; int len; }String; void StrAssign(String *T,char *s) { int i=0; while(s[i]!='\0') { T->ch[i]=s[i];原创 2015-01-26 20:58:55 · 399 阅读 · 0 评论 -
数据结构实验八——队列打印杨辉三角
#include #include #define M 50 typedef struct SeqQueue { int element[M]; int front; int rear; }SeqQueue; void InitQueue(SeqQueue *Q) { Q->front=Q->rear=0; } int EnQueue(SeqQueue *Q,i原创 2015-01-22 21:36:17 · 4975 阅读 · 0 评论