
C++
码农—杰
这个作者很懒,什么都没留下…
展开
-
二叉树的深度
#include<iostream>using namespace std;typedef struct BiTNode{ char data; struct BiTNode *lchild,*rchild; }BiTNode,*BiTree;int num = 0;void createTree(BiTree &T){ char ch; cin >> ch; if(ch == '#') T=NULL; .原创 2021-12-18 22:01:21 · 623 阅读 · 0 评论 -
二叉树的节点个数
#include<iostream>using namespace std;typedef struct BiTNode{ char data; struct BiTNode *lchild,*rchild; }BiTNode,*BiTree;int num=0;void CreatBiTree(BiTree &T){ char ch; cin >> ch; if(ch == '#') T=NULL;.原创 2021-12-17 20:55:15 · 780 阅读 · 0 评论 -
串的基本操作
#include<stdio.h>#include<stdlib.h>#define MAXSIZE 100typedef struct string //顺序串的结构体{ char ch[MAXSIZE + 1]; int length;}string;int StringAssign(string *S, char chs[]) //生成一个其值等于字符串常量chs的串S{ int i = 0; while (chs[i] !.原创 2021-12-16 20:45:29 · 236 阅读 · 0 评论 -
用栈判断是否回文数
#include <iostream>#include <string.h>#define MAXSIZE 100#define ERROR 0#define OK 1#define OVERFLOW -2using namespace std;typedef int Status;typedef char selemtype;typedef struct{ selemtype *base; selemtype *top; int stacksize;}S.原创 2021-12-15 21:22:28 · 941 阅读 · 0 评论