摘要:
/*二叉树前序、中序、层次层次遍历*/ #include<stdio.h> #include<malloc.h> typedef char ElemType; typedef struct BiTNode { ElemType val; struct BiTNode *lchild,*rchild; 阅读全文
摘要:
/*二叉树递归遍历*/ #include<stdio.h> #include<malloc.h> typedef char ElemType; typedef struct BitNode { ElemType data; struct BitNode * lchild,*rchild; }BitN 阅读全文
摘要:
#include<stdio.h> #define MaxSize 255 typedef struct { char ch[MaxSize]; int length; }SString; void InitStr(SString &S) { S.ch[0]=' '; S.length=0; } v 阅读全文
摘要:
#include<stdio.h> #define MaxSize 255 typedef struct { char ch[MaxSize]; int length; }SString; void InitStr(SString &S) { S.ch[0]=' '; S.length=0; } v 阅读全文
摘要:
#include<stdio.h> #define MaxSize 255 typedef struct { char ch[MaxSize]; int length; }SString; void InitStr(SString &S) { S.ch[0]='¥'; S.length=0; } v 阅读全文
摘要:
(一):中缀表达式转后缀表达式从左到右处理各个元素1.遇到操作数。直接加入后缀表达式2.遇到界限符。遇到'('直接入栈,遇到')'则依次弹出栈内运算符并加入后缀表达式,直到弹出'('为止。注意:'('不加入后缀表达式。3.遇到运算符。依次弹出栈中优先级高于或等于当前运算符的所有运算符,并加入后缀表达 阅读全文
摘要:
#include<stdio.h> #define MaxSize 10 typedef char ElemType; typedef struct { ElemType data[MaxSize]; int top; }SList; void InitSList(SList &S) { S.top 阅读全文
摘要:
#include<stdio.h> #include<malloc.h> typedef char ElemType; typedef struct LinkNode { ElemType data; struct LinkNode *next; }LinkNode; typedef struct 阅读全文
摘要:
#include<stdio.h> #include<malloc.h> typedef char ElemType; typedef struct LinkNode { ElemType data; struct LinkNode *next; }LinkNode; typedef struct 阅读全文
摘要:
/*增设表示元素个数的数据*/ #include<stdio.h> #define MaxSize 10 typedef char ElemType; typedef struct { ElemType data[MaxSize]; int front,rear; int size; }SqQueu 阅读全文