├── Linklist链表 ├── LinkList.cpp ├── LinkNode.h ├── Linklist.h ├── List.h └── 实验卡2-单链表.doc ├── README.md ├── SqList顺序表 ├── SqList.cpp ├── SqList.h └── 实验卡1-顺序表.docx ├── SqQueue队列 ├── SqQueue.cpp ├── SqQueue.h └── SqStack.h ├── Sqstack顺序栈 ├── Linkstack.h ├── STACK.CPP ├── Sqstack.h └── 实验卡3-栈.doc ├── 二叉树 ├── BTNode.h ├── BinaryTree.cpp ├── BinaryTree.h ├── SqQueue.h ├── SqStack.h └── 实验5-二叉树.doc ├── 图的临接矩阵 ├── ALGraph_UDG.cpp ├── ALGraph_UDG.h └── 实验卡6-图的邻接矩阵的操作.doc ├── 期中考试 ├── 2018-2019-1数据结构上机期中考试试题-17级02班.doc ├── Test1 │ ├── Answer.h │ ├── Main.cpp │ └── SqList.h ├── Test2 │ ├── Answer.h │ ├── LinkList.h │ ├── LinkNode.h │ └── Main.cpp └── Test3 │ ├── Answer.h │ ├── BiTree.h │ └── Main.cpp └── 查找 ├── SqList.cpp ├── 实验卡1-顺序表.docx └── 操作说明.txt /Linklist链表/LinkList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/Linklist链表/LinkList.cpp -------------------------------------------------------------------------------- /Linklist链表/LinkNode.h: -------------------------------------------------------------------------------- 1 | #ifndef _LinkNODE_ 2 | #define _LINKNODE_ 3 | 4 | // ?????????? 5 | template 6 | struct LinkNode 7 | { 8 | ElemType data; 9 | LinkNode *next; 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /Linklist链表/Linklist.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/Linklist链表/Linklist.h -------------------------------------------------------------------------------- /Linklist链表/List.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIST_ 2 | #define _LIST_ 3 | 4 | // ??????????? 5 | template 6 | class List { 7 | public: 8 | virtual bool IsEmpty() const=0; 9 | virtual int Length() const=0; 10 | virtual void Clear() = 0; 11 | virtual bool GetElem(ElemType &, int) const = 0; 12 | virtual bool SetElem(const ElemType &,int) = 0; 13 | virtual int LocateElem(const ElemType &) const = 0; 14 | virtual int LocatePrior(const ElemType &) const = 0; 15 | virtual int LocateNext(const ElemType &) const = 0; 16 | virtual bool Insert(const ElemType &, int) = 0; 17 | virtual bool TailInsert(const ElemType &) = 0; 18 | virtual bool Delete(ElemType & ,int i) = 0; 19 | virtual void Traverse(void(*visit)(const ElemType &)) const = 0; 20 | }; 21 | #endif 22 | -------------------------------------------------------------------------------- /Linklist链表/实验卡2-单链表.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/Linklist链表/实验卡2-单链表.doc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 数据结构 2 | 3 | 📜学习C++版本的数据结构,记录一些常用的数据结构算法!🔗 4 | 5 | 此仓库代码基实现语言为纯C++,内容不全,仅供参考~ 6 | -------------------------------------------------------------------------------- /SqList顺序表/SqList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/SqList顺序表/SqList.cpp -------------------------------------------------------------------------------- /SqList顺序表/SqList.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/SqList顺序表/SqList.h -------------------------------------------------------------------------------- /SqList顺序表/实验卡1-顺序表.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/SqList顺序表/实验卡1-顺序表.docx -------------------------------------------------------------------------------- /SqQueue队列/SqQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/SqQueue队列/SqQueue.cpp -------------------------------------------------------------------------------- /SqQueue队列/SqQueue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/SqQueue队列/SqQueue.h -------------------------------------------------------------------------------- /SqQueue队列/SqStack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/SqQueue队列/SqStack.h -------------------------------------------------------------------------------- /Sqstack顺序栈/Linkstack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/Sqstack顺序栈/Linkstack.h -------------------------------------------------------------------------------- /Sqstack顺序栈/STACK.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/Sqstack顺序栈/STACK.CPP -------------------------------------------------------------------------------- /Sqstack顺序栈/Sqstack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/Sqstack顺序栈/Sqstack.h -------------------------------------------------------------------------------- /Sqstack顺序栈/实验卡3-栈.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/Sqstack顺序栈/实验卡3-栈.doc -------------------------------------------------------------------------------- /二叉树/BTNode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/二叉树/BTNode.h -------------------------------------------------------------------------------- /二叉树/BinaryTree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/二叉树/BinaryTree.cpp -------------------------------------------------------------------------------- /二叉树/BinaryTree.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/二叉树/BinaryTree.h -------------------------------------------------------------------------------- /二叉树/SqQueue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/二叉树/SqQueue.h -------------------------------------------------------------------------------- /二叉树/SqStack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/二叉树/SqStack.h -------------------------------------------------------------------------------- /二叉树/实验5-二叉树.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/二叉树/实验5-二叉树.doc -------------------------------------------------------------------------------- /图的临接矩阵/ALGraph_UDG.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/图的临接矩阵/ALGraph_UDG.cpp -------------------------------------------------------------------------------- /图的临接矩阵/ALGraph_UDG.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/图的临接矩阵/ALGraph_UDG.h -------------------------------------------------------------------------------- /图的临接矩阵/实验卡6-图的邻接矩阵的操作.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/图的临接矩阵/实验卡6-图的邻接矩阵的操作.doc -------------------------------------------------------------------------------- /期中考试/2018-2019-1数据结构上机期中考试试题-17级02班.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/期中考试/2018-2019-1数据结构上机期中考试试题-17级02班.doc -------------------------------------------------------------------------------- /期中考试/Test1/Answer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/期中考试/Test1/Answer.h -------------------------------------------------------------------------------- /期中考试/Test1/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/期中考试/Test1/Main.cpp -------------------------------------------------------------------------------- /期中考试/Test1/SqList.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/期中考试/Test1/SqList.h -------------------------------------------------------------------------------- /期中考试/Test2/Answer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/期中考试/Test2/Answer.h -------------------------------------------------------------------------------- /期中考试/Test2/LinkList.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/期中考试/Test2/LinkList.h -------------------------------------------------------------------------------- /期中考试/Test2/LinkNode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/期中考试/Test2/LinkNode.h -------------------------------------------------------------------------------- /期中考试/Test2/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/期中考试/Test2/Main.cpp -------------------------------------------------------------------------------- /期中考试/Test3/Answer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/期中考试/Test3/Answer.h -------------------------------------------------------------------------------- /期中考试/Test3/BiTree.h: -------------------------------------------------------------------------------- 1 | template 2 | struct BTNode 3 | { 4 | ElemType data; 5 | BTNode *lchild; 6 | BTNode *rchild; 7 | }; 8 | 9 | template 10 | class BinaryTree 11 | { 12 | public: 13 | BinaryTree():m_root(NULL){} 14 | ~BinaryTree() 15 | { 16 | _Destroy(m_root); 17 | } 18 | 19 | void Create1(ElemType ch[], const ElemType &endChar); 20 | void PreorderTraverse (void (*visit)(const ElemType &)); 21 | void InorderTraverse (void (*visit)(const ElemType &)); 22 | void PostorderTraverse (void (*visit)(const ElemType &)); 23 | int Depth(); 24 | private: 25 | BTNode *m_root; 26 | void _Destroy(BTNode* &); 27 | 28 | void _Create1(BTNode* &,ElemType ch[],const ElemType &,int &); 29 | void _PreorderTraverse(BTNode* ,void (*visit)(const ElemType &e)); 30 | void _InorderTraverse(BTNode* ,void (*visit)(const ElemType &e)); 31 | void _PostorderTraverse(BTNode* ,void (*visit)(const ElemType &e)); 32 | int _Depth(BTNode*); 33 | }; 34 | 35 | template 36 | void BinaryTree::_Destroy(BTNode* &T) 37 | { 38 | if (T) 39 | { 40 | _Destroy (T->lchild); 41 | _Destroy (T->rchild); 42 | delete T; 43 | } 44 | T = NULL; 45 | } 46 | 47 | template 48 | void BinaryTree ::PreorderTraverse(void (*visit)(const ElemType &e)) 49 | { 50 | _PreorderTraverse(m_root, visit); 51 | } 52 | 53 | template 54 | void BinaryTree ::_PreorderTraverse(BTNode* T,void (*visit)(const ElemType &e)) 55 | { 56 | if (T) 57 | { 58 | visit(T->data); 59 | _PreorderTraverse(T->lchild,visit); 60 | _PreorderTraverse(T->rchild,visit); 61 | } 62 | } 63 | 64 | #include "answer.h" -------------------------------------------------------------------------------- /期中考试/Test3/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/期中考试/Test3/Main.cpp -------------------------------------------------------------------------------- /查找/SqList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/查找/SqList.cpp -------------------------------------------------------------------------------- /查找/实验卡1-顺序表.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/查找/实验卡1-顺序表.docx -------------------------------------------------------------------------------- /查找/操作说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimYangOfCat/Data_Structure/2bb2386d54bfc05168906747bf6597982004632f/查找/操作说明.txt --------------------------------------------------------------------------------