数据结构
qq_38876046
这个作者很懒,什么都没留下…
展开
-
二叉树递归的创建及三种遍历(先序、中序、后序)
#include#include#include#includeusing namespace std;#define status inttypedef struct bitnode {int data;struct bitnode *lchild;struct bitnode *rchild;} bitnode,*sq;int r=0;bit原创 2017-10-13 19:12:54 · 527 阅读 · 0 评论 -
(搜索)POJ-1979 Red and Black
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can'...原创 2018-03-24 14:24:34 · 108 阅读 · 0 评论 -
顺序表
#include#include#include#includeusing namespace std;#define sizelist 100#define listincrease 10#define error -1#define ok 0typedef struct{ int *data; int length; int listsize;}原创 2017-11-24 20:37:20 · 133 阅读 · 0 评论 -
二叉树求叶子数、树的高度
#include#include#include#includeusing namespace std;#define status inttypedef struct bitnode{ char data; struct bitnode *lchild; struct bitnode *rchild;} bitnode,*sq;int r=0;bitnode *q;i原创 2017-10-16 14:06:07 · 383 阅读 · 0 评论 -
直接插入排序
#include#include#includeusing namespace std;typedef struct{ int *r; int length;} sqlist;void createlink(sqlist &L){ int n; L.length=0; cout<<"输入链表长度:"<<endl; cin>>n;原创 2017-11-22 20:14:16 · 136 阅读 · 0 评论 -
折半排序
#include#include#includeusing namespace std;typedef struct{ int *r; int length;} sqlist;void createlink(sqlist &L){ int n; L.length=0; cout<<"输入链表长度:"<<endl; cin>>n;原创 2017-11-22 20:10:02 · 211 阅读 · 0 评论 -
快速排序
#include#include#includeusing namespace std;typedef struct{ int *r; int length;} sqlist;void createlink(sqlist &L){ int n; L.length=0; cout<<"输入链表长度:"<<endl; cin>>n;原创 2017-11-22 20:02:37 · 145 阅读 · 0 评论 -
希尔排序
#include#include#includeusing namespace std;typedef struct{ int *r; int length;} sqlist;void createlink(sqlist &L){ int n; L.length=0; cout<<"输入链表长度:"<<endl; cin>>n;原创 2017-11-22 19:52:44 · 202 阅读 · 0 评论 -
堆排序
#include#include#includeusing namespace std;typedef struct{ int *r; int length;}sqlist;void createlink(sqlist &L){ int n; L.length=0; cout<<"输入链表长度:"<<endl; cin>>n;原创 2017-11-22 19:36:25 · 188 阅读 · 0 评论 -
循环链表应用之约瑟夫环
#include#include#includeusing namespace std;typedef struct node{ char data; struct node *next;}slink,*ad;ad createlink(slink *head){ slink *p,*s; int n; cout<<"输入链表长度:"<<en原创 2017-11-15 17:29:14 · 263 阅读 · 0 评论 -
循环链表
#include#include#includeusing namespace std;typedef struct node{ int data; struct node *next;}slink,*ad;ad createlink(slink *head){ slink *p,*s; int n; cout<<"输入链表长度:"<<end原创 2017-11-12 20:56:00 · 122 阅读 · 0 评论 -
二叉树非递归层次遍历
#include#include#include#includeusing namespace std;#define status inttypedef struct node{ int data; struct node *next; struct node *lchild; struct node *rchild; struct node *front; struc原创 2017-10-16 09:32:36 · 235 阅读 · 0 评论 -
二叉树非递归遍历之中序遍历
#include#include#include#includeusing namespace std;#define status inttypedef struct bitnode{ char data; struct bitnode *next; struct bitnode *lchild; struct bitnode *rchild;}linkstack,*sq原创 2017-10-14 20:01:35 · 147 阅读 · 0 评论 -
(搜索应用)Oil Deposits( UVA - 572 )
Oil Deposits UVA - 572 #include <iostream>#include<stdio.h>#include<queue>#include<stdlib.h>#include<string.h>using namespace std;char a[100][100];int vis[100][100...原创 2018-04-15 19:12:14 · 106 阅读 · 0 评论