随笔 - 58  文章 - 1  评论 - 5  阅读 - 10万

随笔分类 -  数据结构基础

二叉树的Java实现
摘要:按层遍历 输出: 结果: 阅读全文
posted @ 2018-07-24 10:29 lie隼 阅读(390) 评论(0) 推荐(1) 编辑
几种排序算法的Java实现
摘要:结论: 代码: 阅读全文
posted @ 2018-07-23 22:00 lie隼 阅读(217) 评论(0) 推荐(0) 编辑
一些关于链表操作的代码
摘要:#include #include #include #define SIZE 10 struct node { int num; struct node *next; }; struct stud { char name[10]; int num; }sw[5],sr[5],*pw,*pr; void selectsort(int *); void b... 阅读全文
posted @ 2017-03-18 00:31 lie隼 阅读(161) 评论(0) 推荐(0) 编辑
简单二叉树的建立和遍历
摘要:#include#include//定义节点typedef struct BiNode{ char data; struct BiNode *lch; struct BiNode *rch;}BiNode,*BiTree;//先序建立二叉树void Crea... 阅读全文
posted @ 2017-03-13 13:47 lie隼 阅读(294) 评论(0) 推荐(0) 编辑
约瑟夫环问题之选猴王
摘要:n只猴子围成一圈,顺时针方向从1到n编号。之后从1号开始沿着顺时针方向让猴子从1,2,3……,m依次报数,凡报到m的猴子都让其出圈,取消候选资格。然后不停的俺顺时针方向报数,让报到m的猴子出圈,最后剩下一个就是猴王。#include #include struct mon{ int num; ... 阅读全文
posted @ 2015-10-28 21:38 lie隼 阅读(292) 评论(0) 推荐(0) 编辑
快速排序以及二分查找的实现
摘要:#include int BinSearch(int a[],int left,int right,int key);//声明二分查找void QuickSort(int a[],int left,int right);//声明快速排序int main(){ int a[101]; in... 阅读全文
posted @ 2015-10-28 10:57 lie隼 阅读(161) 评论(0) 推荐(0) 编辑
顺序队列的基本操作
摘要:#include #include //#include #define MAXSIZE 100#define OK 1#define TRUE 1#define FALSE 0#define ERROR 0//using namespace std;typedef struct{ int d... 阅读全文
posted @ 2014-02-11 21:56 lie隼 阅读(904) 评论(0) 推荐(0) 编辑
基于顺序栈的进制转换
摘要:#include #include #define M 10typedef struct //定义一个顺序栈{ int data[M]; int top;}SqStack;void InitStack(SqStack &st)//创建一个栈{ st.top=-1;}int Pu... 阅读全文
posted @ 2013-10-09 09:36 lie隼 阅读(377) 评论(0) 推荐(0) 编辑
队列的链式存储及其基本运算
摘要:#include #include #define QueueSize 10typedef struct Qnode //链队列的定义{ char data; struct Qnode *next;}Qtype; //链队中节点类型typedef s... 阅读全文
posted @ 2013-08-15 15:42 lie隼 阅读(363) 评论(0) 推荐(0) 编辑
队列的顺序存储及其基本操作
摘要:#include #include #define QueueSize 10typedef struct{ char data [QueueSize]; int front,rear;}SqQueue;void InitQueue(SqQueue &qu) //初始化队列{ qu... 阅读全文
posted @ 2013-08-15 09:57 lie隼 阅读(387) 评论(0) 推荐(0) 编辑
栈的顺序存储及其基本操作
摘要:#include #include #define M 10typedef struct //定义一个顺序栈{ char data[M]; int top;}SqStack;void InitStack(SqStack &st)//创建一个栈{ st.top=-1;}int P... 阅读全文
posted @ 2013-08-14 11:13 lie隼 阅读(345) 评论(0) 推荐(0) 编辑
栈的链式存储及其基本运算
摘要:#include #include #define M 10typedef struct stnode{ char data; struct stnode *next;}LinkStack;void InitStack(LinkStack *&ls) //初始化栈{ ls=NUL... 阅读全文
posted @ 2013-08-14 10:56 lie隼 阅读(271) 评论(0) 推荐(0) 编辑
链表的逆置,归并,拆分以及其他函数集合
摘要:#include #include struct node{ int data; struct node *next;};struct node * creat1(int n)//逆序建立链表{ struct node *head,*p; int i; head=(st... 阅读全文
posted @ 2013-08-10 11:07 lie隼 阅读(456) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示