![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 77
cjliux
这个作者很懒,什么都没留下…
展开
-
C++实现稀疏矩阵的十字链表表示法
/* * OLMat.h * * Created on: Oct 17, 2015 * Author: chris */#ifndef OLMAT_H_#define OLMAT_H_#includetypedef int ElemType;struct OLNode{ int i, j; ElemType e; OLNode *right, *dow原创 2015-10-17 20:13:06 · 1247 阅读 · 0 评论 -
C++实现多项式操作及其加减乘除
/* * Polynomial.h * * Created on: Oct 6, 2015 * Author: chris */#ifndef POLYNOMIAL_H_#define POLYNOMIAL_H_#includestruct Term{ double coef; int exp; Term * next; Term():coef(0)原创 2015-10-06 23:40:51 · 8838 阅读 · 0 评论 -
C++实现循环队列
/* * SqQueue.h * * Created on: Oct 7, 2015 * Author: chris */#ifndef SQQUEUE_H_#define SQQUEUE_H_typedef int ElemType;enum{SQQUEUEINITSIZE = 30};struct SqQueue{ ElemType * data;原创 2015-10-07 09:34:36 · 515 阅读 · 0 评论 -
C++实现链栈
/* * LkStack.h * * Created on: Oct 7, 2015 * Author: chris */#ifndef LKSTACK_H_#define LKSTACK_H_typedef int ElemType;struct LSNode{ ElemType data; LSNode * next;};struct LkSta原创 2015-10-07 09:30:30 · 400 阅读 · 0 评论 -
C++实现串的最小操作子集
/* * HString.h * * Created on: Oct 7, 2015 * Author: chris */#ifndef HSTRING_H_#define HSTRING_H_#includestruct HString{ int length; char *ch; HString(): length(0), ch(NULL) {}}原创 2015-10-07 15:58:22 · 1010 阅读 · 0 评论 -
C++实现KMP算法(优化版)
/* * Main.cpp * * Created on: Oct 7, 2015 * Author: chris */#include#include#includeusing namespace std;void get_next(const string pat, vector& next){ next.resize(pat.length(), 0原创 2015-10-07 18:15:09 · 399 阅读 · 0 评论 -
C++实现B-树插入删除查找
/* * BMT.h * * Created on: Nov 2, 2015 * Author: chris */#ifndef BMT_H_#define BMT_H_#include#define m 3struct Record{ //empty.};typedef int KeyType;typedef struct BMTNode{原创 2015-11-15 15:19:51 · 1432 阅读 · 3 评论 -
C++实现图的十字链表表示及相关各算法
/* * OLGraph.h * * Created on: Oct 19, 2015 * Author: chris */#ifndef OLGRAPH_H_#define OLGRAPH_H_#include#include#define MAX_VERTEX_NUM 20#define INF INT_MAXstruct InfoType{ in原创 2015-10-31 19:45:45 · 965 阅读 · 1 评论 -
C++实现二叉搜索树和AVL树
/* * BST.h * * Created on: Oct 31, 2015 * Author: chris */#ifndef BST_H_#define BST_H_#includetypedef int KeyType;struct ElemType{ int val; ElemType(): val(0) {}};typedef struc原创 2015-11-02 18:55:39 · 350 阅读 · 0 评论 -
C++实现哈希表的创建,销毁,键值插入与删除
/** HashTable.h** Created on: Nov 19, 2015* Author: chris*/#pragma once#include const int numofsizes = 7;const int hashsize[] = { 11, 19, 31, 41, 53, 61, 71 };typedef int KeyType;原创 2015-12-01 09:05:20 · 4369 阅读 · 0 评论 -
C++实现离散事件模拟--Bank_Simulation
/** LkQueue.h** Created on: Oct 7, 2015* Author: chris*/#ifndef LKQUEUE_H_#define LKQUEUE_H_#includeusing namespace std;templatestruct LQNode{ ElemType data; LQNode * next; LQ原创 2015-10-07 11:51:31 · 1133 阅读 · 0 评论 -
C++实现KMP算法(修正版,C++风格)
/* * Main.cpp * * Created on: Oct 7, 2015 * Author: chris */#include#include#includeusing namespace std;void get_next(const string pat, vector& next){ next.resize(pat.length(), 0原创 2015-10-07 17:54:36 · 434 阅读 · 0 评论 -
C++实现二叉树及其线索化和遍历
/* * BiTree.h * * Created on: Oct 17, 2015 * Author: chris */#ifndef BITREE_H_#define BITREE_H_#includetypedef int ElemType;struct BTNode { ElemType data; BTNode *lchild, *rchild原创 2015-10-18 11:18:04 · 584 阅读 · 1 评论 -
C++实现广义表及其遍历
/* * GList.h * * Created on: Oct 19, 2015 * Author: chris */#ifndef GLIST_H_#define GLIST_H_#includetypedef int AtomType;enum ElemTag{ATOM, LIST};struct GLNode{ ElemTag tag; uni原创 2015-10-19 20:45:20 · 656 阅读 · 0 评论 -
C++实现双向链表
/* * DLList.h * * Created on: Oct 6, 2015 * Author: chris */#ifndef DLLIST_H_#define DLLIST_H_typedef int ElemType;typedef struct DLNode{ ElemType data; DLNode* prior; DLNode* nex原创 2015-10-06 19:25:31 · 382 阅读 · 0 评论 -
C++实现链队列
/* * LkQueue.h * * Created on: Oct 7, 2015 * Author: chris */#ifndef LKQUEUE_H_#define LKQUEUE_H_typedef int ElemType;struct LQNode{ ElemType data; LQNode * next;};struct LkQueu原创 2015-10-07 09:36:18 · 369 阅读 · 0 评论 -
C++实现单链表
/* * LinkList.h * * Created on: Oct 6, 2015 * Author: chris */#ifndef LINKLIST_H_#define LINKLIST_H_typedef int ElemType;typedef struct SLNode { ElemType data; SLNode * next;}*SLL原创 2015-10-06 16:17:26 · 331 阅读 · 0 评论 -
C++实现顺序栈
/* * Stack.h * * Created on: Oct 6, 2015 * Author: chris */#ifndef SQSTACK_H_#define SQSTACK_H_typedef int ElemType;enum {STACKINITSIZE = 10, STACKINCSIZE = 10};struct SqStack{ El原创 2015-10-07 09:32:36 · 321 阅读 · 0 评论 -
C++实现KMP算法(C风格)
/* * Main.cpp * * Created on: Oct 7, 2015 * Author: chris */#include#includeusing namespace std;bool get_next(const char* pat, int*& next){ int len = strlen(pat); next = new int[原创 2015-10-07 17:05:52 · 370 阅读 · 0 评论 -
C++实现KMP算法(单值返回版)
/* * Main.cpp * * Created on: Oct 7, 2015 * Author: chris */#include#includeusing namespace std;bool get_next(const char* pat, int*& next){ int len = strlen(pat); next = new int[原创 2015-10-07 17:26:58 · 431 阅读 · 0 评论 -
C++实现线性表
/* * SqList.h * * Created on: Oct 6, 2015 * Author: chris */#ifndef SQLIST_H_#define SQLIST_H_#include#includetypedef int ElemType;enum {SQLISTINITSIZE = 10, SQLISTINCSIZE = 10};s原创 2015-10-06 12:26:37 · 406 阅读 · 0 评论 -
C++实现红黑树建立,销毁,查找,插入和删除
/** RBT.h** Created on: Nov 30, 2015* Author: chris*/#pragma once#includeenum NodeColor{RED, BLACK};typedef int KeyType;struct RBTNode{ RBTNode *right, *left, *p; NodeColor colo原创 2015-12-01 09:10:14 · 765 阅读 · 0 评论