数据结构
文章平均质量分 76
木瓜敲代码
这个作者很懒,什么都没留下…
展开
-
数据结构之顺序表的基本操作(C++)
#include<iostream> using namespace std; #define increment 10 class sqlist{ private: int *elem; int listsize; int length; public: sqlist(int n); ~sqlist(); void sqlist...原创 2018-07-28 17:29:57 · 881 阅读 · 0 评论 -
数据结构之链表基本操作(C++)
#include<iostream> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x):val(x),next(NULL){} }; /********************************************************...原创 2018-07-28 21:41:29 · 399 阅读 · 0 评论 -
数据结构之栈的操作及应用(C++;进制转换;括号匹配)
#include<iostream> #include<string.h> using namespace std; #define STACK_INIT_SIZE 100 #define TURE 1 #define FALSE 0 struct SqStack{ int *base; int *top; int stacksize; }; v...原创 2018-07-29 21:41:45 · 236 阅读 · 0 评论 -
数据结构之邻接表存储有向图或无向图及其相关操作(C++)
#include<iostream> using namespace std; #define maxsize 20 //边表 typedef struct ArcNode{ int adjvex;//结点的数据域,存顶点号 int info;//结点的数据域,保存边的权值 ArcNode *nextarc;//结点的指针域,指向下一条边结点 }ArcNod...原创 2018-08-04 10:55:06 · 2075 阅读 · 0 评论 -
数据结构之二叉树的基本操作(C++)
#include<iostream> using namespace std; typedef struct bstnode{ int data; bstnode *lchild,*rchild; }bstnode,*linkbst; class bst{ public: bstnode *t; bst(){t=NULL;} void ino...原创 2018-07-31 17:15:28 · 761 阅读 · 0 评论