数据结构
prettysky123
这个作者很懒,什么都没留下…
展开
-
数据结构——线性表的建立和有序输出
建立空的线性表; 输入表中的元素; 在输入的过程中将输入的元素依次插入建立好的线性表中; 在插入的过程中排序; 输出已经排序好了的有序线性表;#include<iostream>#include<stdlib.h># define LIST_INIT_SIZE 100# define LISTINCREMENT 10# define ElemType int# define OVE原创 2015-09-08 13:18:43 · 1426 阅读 · 0 评论 -
数据结构——有序线性表的的插入与删除
有序线性表的插入与删除#include<iostream>#include<stdlib.h># define LIST_INIT_SIZE 100# define LISTINCREMENT 10# define ElemType int# define OVERFLOW -1# define ERROR -1using namespace std;typedef struct {原创 2015-09-08 17:00:23 · 1023 阅读 · 0 评论 -
数据结构——有序单链表的建立、插入与删除
#include <iostream>#include <cstdlib>#define ElemType intusing namespace std;typedef struct Node { int val; Node *next; }Node, *LinkList;int Init_node(LinkList& L){ L = (LinkList原创 2015-09-14 08:41:15 · 1207 阅读 · 0 评论 -
数据结构--二叉树的创建、先序遍历、中序遍历、后序遍历、深度、叶子结点数
*用cin来读取char类型时,没法读入“ ”(space),所以要改用getchar()(在头文件#include<iostream>#include<stdlib.h>#include<stdio.h>using namespace std;typedef struct BiTNode { char date; struct BiTNode *lchild, *rchil原创 2015-11-05 10:24:45 · 707 阅读 · 0 评论 -
数据结构--栈的构造、插入、删除、得到栈顶元素操作
*非空栈中的栈顶指针始终在栈顶元素的下一个位置; *top为栈顶指针其初值指向栈底,即top = base 可作为栈空的标记插入新的栈顶元素,指针top增1;删除栈顶元素时指针top减1;#include<iostream>#include<stdlib.h># define STACK_INIT_SIZE 100# define STACKINCREMENT 10# define Ele原创 2015-10-10 15:34:13 · 11533 阅读 · 0 评论 -
KMP算法
转载自链接:https://www.zhihu.com/question/21923021/answer/281346746作者:海纳 来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。有些算法,适合从它产生的动机,如何设计与解决问题这样正向地去介绍。但KMP算法真的不适合这样去学。最好的办法是先搞清楚它所用的数据结构是什么,再搞清楚怎么用,最后为什么的问题就会有...转载 2019-07-23 20:25:41 · 119 阅读 · 0 评论