
数据结构
Biteee
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数据结构 C/C++ 有向邻接表
#include<stdio.h>#define MAX 100typedef struct node{ int adjvex; struct node *nextadj;}Edgenode;typedef struct vnode{ char vertex; Edgenode *firstedge;}Vernode;typedef V...原创 2020-01-31 16:36:07 · 268 阅读 · 0 评论 -
数据结构 C/C++ 线索二叉树
#include<stdio.h>typedef int datatype;typedef char Datatype;typedef struct Bithrnode{ Datatype data; struct Bithrtree *lchild; struct Bithrtree *rchild; int ltag,rtag;}Bit...原创 2020-01-31 16:33:55 · 174 阅读 · 0 评论 -
数据结构 C/C++ 二分插入排序
#include<stdio.h>#define max 50void sort(int a[],int n){ int i,j; i=1; while(i<n) { int x=a[i]; int high=0; int low=i-1; while(high<=low...原创 2020-01-30 21:19:36 · 443 阅读 · 0 评论 -
二叉树的非递归遍历 前序 中序 后序 -----完美运行
#include<stdio.h>#include<stdlib.h>#define MAX 100typedef struct{ bitree ptr; int flag;}stacknode;typedef struct{ stacknode elm[MAX]; int top;}sqstack;typedef str...原创 2020-01-30 21:18:02 · 230 阅读 · 0 评论 -
数据结构 递归遍历二叉树 C/C++
#include<stdio.h>#include<stdlib.h>typedef struct btnode{ char data; struct btnode *lchild,*rchild;}btnode,*bitree;bitree Creatbintree() //前序遍历创建二叉树{ char...原创 2020-01-30 21:16:47 · 608 阅读 · 0 评论 -
数据结构 C/C++ 冒泡排序
#include<stdio.h>#define max 40void sort(int a[],int n){ int i,j,k,t; for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if(a[i]>a[j]) { ...原创 2020-01-30 21:11:52 · 236 阅读 · 0 评论 -
数据机构 C/C++ 快速排序
#include<stdio.h>#define max 50void sort(int a[],int left,int right){ if(left>=right) return; int i=left; int j=right; int key=a[left]; while(i<j) { ...原创 2020-01-27 12:45:46 · 182 阅读 · 0 评论 -
数据结构 C/C++ 关键路径
#include <stdio.h>#include <stdlib.h>#include <string.h>//定义邻接表typedef struct node{ int adjvex; int w; struct node *nextedge; }edgenode;typedef struct{ char ...原创 2020-01-11 11:07:11 · 238 阅读 · 0 评论 -
模式匹配 VS KMP
KMP 模式匹配原创 2020-01-09 14:21:31 · 309 阅读 · 0 评论 -
数据结构 C/C++ 稀疏矩阵
#include<stdio.h>#define MAX_SIZE 101typedef int elemtype;typedef struct{ int row; int col; elemtype value;}Triple;typedef struct{ int rn; int cn; int tn; Tr...原创 2020-01-09 14:19:51 · 1338 阅读 · 1 评论 -
数据结构 C/C++ 三角矩阵
#include<stdio.h>int main(){ int M,N; printf("请输入矩阵阶数n:"); scanf("%d",&N); int a[N][N],i,j,t=0; M=(N+1)*N/2; int k[M],m;C: printf("请选择三角矩阵类型:\n1.上三角矩阵\n2.下三角矩阵\n...原创 2020-01-09 14:18:14 · 2624 阅读 · 0 评论 -
数据结构 C/C++ 链栈
#include<stdio.h>typedef int datatype;typedef struct node //链栈的定义{ datatype data; struct node *next;}Stacknode,*Linkstack;Linkstack Init_Linkstack() //链栈置空...原创 2020-01-09 14:16:43 · 314 阅读 · 0 评论 -
数据结构 C/C++ 链式队列
#include<stdio.h>typedef int datatype;typedef struct node //定义队节点的类型{ datatype data; struct node *next;}Qnode;typedef struct //将队头,队尾指针封装在一起{ Qnode *...原创 2020-01-09 14:15:16 · 266 阅读 · 0 评论 -
数据结构 C/C++ 对角矩阵
#include<stdio.h>int main(){ int i,j,N,t=0,n,m,o,p=0; printf("请输入矩阵阶数N:"); scanf("%d",&N);A: printf("请输入对角矩阵的带宽n:"); scanf("%d",&n); if(n%2==0) { pri...原创 2020-01-09 14:13:45 · 2125 阅读 · 0 评论 -
数据结构 C/C++ 对称矩阵
#include<stdio.h>#include<stdlib.h>static int N,M;void Out(int a[N][N]) //对称矩阵输出{ int j,i; printf("矩阵为:\n"); for(i=0;i<N;i++) for(j=0;j<N;j++) ...原创 2020-01-09 14:11:52 · 1484 阅读 · 0 评论 -
C/C++ 数据结构 单链表
#include<stdio.h>#define flag '#'typedef int datatype;typedef struct node{ datatype data; struct node *next;}LNODE,*Linklist; //定义单链表的结构体Linklist Creath_Linklist...原创 2020-01-09 14:09:53 · 335 阅读 · 0 评论