![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
Jey_lucky
这个作者很懒,什么都没留下…
展开
-
利用栈实现逆波兰式求值
为了简便,我这里没有考虑除数为0这些细节#include #include#include #define STACKINITSIZE 100//初始化空间分配量using namespace std;struct Stack{ int* base; int* top; int stackSize;};void createS原创 2017-06-04 21:01:56 · 701 阅读 · 0 评论 -
c++实现链表 增,删,查,合并
#include # includeusing namespace std;struct linkList{ int data; linkList* next;};linkList* createList(){//创建一个带头结点的链表,数据域记录链表长度,初始化为0 linkList* L=new linkList(); L->data原创 2017-05-29 20:02:49 · 291 阅读 · 0 评论 -
c++实现队列
#include using namespace std;struct node{//节点双向方便找尾指针的前驱 node* pre; int data; node* next;};struct queueL{ node* head;//头指针 node* tail;//尾指针};queueL* init(){ queueL*原创 2017-06-06 14:41:08 · 377 阅读 · 0 评论 -
c++实现双向有序链表的,增,删,查,合并
#includeusing namespace std;struct DouLinkList{ DouLinkList* pre; int data; DouLinkList* next;};DouLinkList* createLinkList(){//创建一个带头结点的双向链表,头结点数据域记录链表长度 DouLinkList*原创 2017-06-02 07:57:52 · 1827 阅读 · 0 评论 -
c++用模板类封装了队列 提高了可重用性
#include using namespace std;template //定义模板类class Queue{public: Queue(int MaxQueueSize=5); void add(const Type&); Type Delete();private: int tail; int head; Ty原创 2017-06-08 11:13:01 · 372 阅读 · 0 评论 -
顺序栈的c++实现
#include #define STACKINITSIZE 100//初始化空间分配量using namespace std;struct Stack{ int* base; int* top; int stackSize;};void createStack(Stack* s){//创建并初始化 s->top=s->base原创 2017-06-04 17:18:33 · 306 阅读 · 0 评论 -
c++二叉排排序树的实现 补上了删除和查找操作
#include #includeusing namespace std;class node{ friend class tree;public: node* left; int data; node* right;};class tree{public: node* root; tree(){ r原创 2017-06-21 19:04:47 · 229 阅读 · 0 评论