
数据结构
康总
这个作者很懒,什么都没留下…
展开
-
栈的应用习题
//中缀表达式转后缀表达式/*特别注意 中缀表达式转为后缀表达式:当运算符优先级比栈顶运算符高时直接入运算栈,如果等于或低于栈顶运算符时将运算符栈的出栈 (转为前缀表达式时没有等于)*/#include <iostream>#include <stack>using namespace std;int main(){ string str; stack<char> opr;原创 2017-11-09 15:41:16 · 511 阅读 · 0 评论 -
栈的基本操作
把栈的基本操作写成了一个小小的子系统,仅供参考/* 栈结构的栈底元素的next域为空 栈顶的next域指向第二个元素位置*/#include <stdio.h>#include <stdlib.h>typedef char datatype;typedef struct stacknode // 定义栈节点结构{ datatype data; struct st原创 2017-11-02 18:03:45 · 219 阅读 · 0 评论 -
链表改进版基本操作
对之前一次的链表进行了改进#include <stdio.h>#include <stdlib.h>typedef char datatype;typedef struct list{ datatype data; struct list *next;}node;node *head = NULL, *r;void creat() // 尾插法建表,带有头结点{原创 2017-11-02 18:59:41 · 257 阅读 · 0 评论 -
c语言实现二叉树常用算法
构造二叉树结点结构typedef struct BT{ char data; struct BT *l_chrild; struct BT *r_chrild;}BT;创建二叉树BT* Create_tree()// 创建二叉树{ BT *bt; char x; scanf("%c",&x); getchar(); if (x原创 2017-12-02 15:23:00 · 3840 阅读 · 1 评论