随笔分类 -  数据结构

摘要:#include <stdio.h> void swap(int *a, int *b); void bubble_sort(int a[], int n); void select_sort(int a[], int n); void insert_sort(int a[], int n); vo 阅读全文
posted @ 2015-12-18 14:19 wojiaohuangyu 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<stdio.h> #include<string.h> using namespace std; typedef struct BiNide{ char data; struct BiNide *lchild,*rchild; }BiTNode 阅读全文
posted @ 2015-06-24 18:16 wojiaohuangyu 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<stdio.h> #include<string.h> #define OK 1 #define OVERFLOW -2 #define ERROR 0 #define MAXSIZE 255 using namespace std; type 阅读全文
posted @ 2015-06-23 23:32 wojiaohuangyu 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<stdio.h> #include<string.h> #define MAXSIZE 255 #define ERROR 0 #define OVERFLOW -1 #define OK 1 using namespace std; type 阅读全文
posted @ 2015-06-23 23:29 wojiaohuangyu 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; #define OK 1 #define ERROR 0 #define OVERFLOW -2 typedef int Status; typedef int QElemType; typedef struct QNo 阅读全文
posted @ 2015-05-23 22:41 wojiaohuangyu 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; #define OK 1 #define ERROR 0 #define OVERFLOW -2 #define MAXSIZE 100 typedef int QElemType; typedef int Status 阅读全文
posted @ 2015-05-23 17:38 wojiaohuangyu 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; #define OK 1 #define ERROR -1 #define OVERFLOW -2 typedef int Status; typedef struct SNode{ int data; struct S 阅读全文
posted @ 2015-05-23 15:38 wojiaohuangyu 阅读(7) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; #define OK 1 #define ERROR 0 #define OVERFLOW -2 typedef int Status; typedef struct SNode{ int data; struct SN 阅读全文
posted @ 2015-05-23 13:34 wojiaohuangyu 阅读(7) 评论(0) 推荐(0) 编辑
摘要:根据老师的代码进行改编 #include<iostream> #include<cstdlib> using namespace std; #define OK 1 #define ERROR 0 #define OVERFLOW -2 #define MAXSIZE 100 typedef int 阅读全文
posted @ 2015-05-22 18:36 wojiaohuangyu 阅读(5) 评论(0) 推荐(0) 编辑
摘要:链表的基本操作。 #include<iostream> #include<cstring> #define OK 1 #define ERROR 0 #define OVERFLOW -2 using namespace std; typedef int ElemType; typedef int 阅读全文
posted @ 2015-05-22 17:14 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:涉及到链表的建立、删除、输入、输出 链表的归并 #include<iostream> using namespace std; #define ERROR 0 #define OK 1 typedef int ElemType; typedef int Status; typedef struct 阅读全文
posted @ 2015-05-21 13:59 wojiaohuangyu 阅读(8) 评论(0) 推荐(0) 编辑
摘要:涉及到链表的建立、链表的输入、链表的输出、以及链表的归并、链表的插入 #include<iostream> #define OK 1 #define ERROR 0 using namespace std; typedef struct LNode{ int data; struct LNode * 阅读全文
posted @ 2015-05-19 22:10 wojiaohuangyu 阅读(5) 评论(0) 推荐(0) 编辑
摘要:顺序表的思想容易了解,但是代码不容易掌握,我这里根据老师所提供的代码进行一下简单的总结 这个代码包含顺序表的查找,插入,删除,建表,输出数据 #include<iostream> using namespace std; #define OK 1 #define ERROR 0 #define OV 阅读全文
posted @ 2015-05-14 14:12 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:测试的是对二叉树的建立 及处理 代码 #include<iostream> #include<string.h> #include<queue> #include<stack> using namespace std; const int max=100000; typedef struct BiN 阅读全文
posted @ 2015-05-05 17:47 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:#include<stdio.h> #include<stdlib.h> #include<string.h> #define N 1000100 int num[N]; long long ans; void guibing(int a_1,int a_2,int b_1,int b_2){//归 阅读全文
posted @ 2015-05-04 13:50 wojiaohuangyu 阅读(5) 评论(0) 推荐(0) 编辑
摘要:大概意思就是用的递归,先向左子树递归,然后向右子树递归。。。 #include<stdio.h> #include<string.h> char str[100],zf[100]; void deal(int num_x,int num_y,int num_a,int num_b){ int i,j 阅读全文
posted @ 2015-04-15 21:43 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:汉诺塔的规律就是当有n层时,一共需要移动2的n次方减1次 那么问题来了,求2的n次方。。。。 #include<stdio.h> #include<string.h> long long deal(long long n){ long long t; if(n==1) return 2; t=dea 阅读全文
posted @ 2015-04-15 19:53 wojiaohuangyu 阅读(2) 评论(0) 推荐(0) 编辑
摘要:虽然比较简单,但是我还是很吃力的才做出来,参考大神的方法。。。 大概思路就是递归,先找出来第一个根,然后根据此根将左子树跟右子树分开,无论是后序还是中序依据根分开,然后再依次递归 #include<stdio.h> #include<string.h> //void deal(char right_ 阅读全文
posted @ 2015-04-14 18:13 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:虽然这都题目简单,但还是花了我俩小时,总是找不到错误。。 本题目用到了栈 #include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> #include<stack> using namespace std; cha 阅读全文
posted @ 2015-04-11 09:21 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:看大神的代码看了好久,我自己感觉不太好理解 代码: #include<stdio.h> #include<string.h> #include<stack> #include<queue> using namespace std; char str[1200]; int fun(char ch){ 阅读全文
posted @ 2015-04-07 15:40 wojiaohuangyu 阅读(3) 评论(0) 推荐(0) 编辑

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