![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构与算法
EHW-LIAO
SCU学生一枚
展开
-
【数据结构与算法】单链表程序练习
#include <stdio.h>#define ERROR 0#define OK 1 #define ElemType inttypedef int status;typedef struct Node{ ElemType data; struct Node* next; }Node;typedef struct Node* Linklist;/*遍历链表...原创 2018-04-17 15:59:01 · 291 阅读 · 0 评论 -
排序总结
#include"stdafx.h"#include<iostream>#include<vector>using namespace std;/*-----------------各大排序算法-------------------*/void swap_elem(int &a, int &b){ int temp = a; a = b...原创 2018-08-24 09:57:29 · 123 阅读 · 0 评论 -
【数据结构与算法】栈的应用-中缀表达式转为后缀表达式
#include <stdio.h>#define ERROR 0#define OK 1 #define ElemType char#define N 10#define STACK_INIT_SIZE 100#define STACKINCERMENT 10typedef int status;typedef struct{ ElemType *top; El...原创 2018-04-27 16:04:26 · 138 阅读 · 0 评论 -
【数据结构与算法】BF和KMP算法
#include <stdio.h>#include <string.h>#define MAXSIZE 100//字符串匹配//BF暴风解法int boyfriend(char p[],char q[]){ int p_len,q_len; int i=0,j=0; p_len=strlen(p); printf("p_len=%d\n",p_le...原创 2018-05-05 13:03:53 · 742 阅读 · 0 评论 -
【数据结构与算法】二叉树的建立与线索化
#include <stdio.h>#include <stdlib.h> #include <string.h>#define MAXSIZE 100typedef enum{Link,Thread} PointerTag; // 输入前序遍历,创建一棵树 typedef struct BitNode{ char data; struct...原创 2018-05-09 16:08:50 · 183 阅读 · 0 评论 -
【数据结构与算法】栈的应用-括号匹配
#include <stdio.h>#define ERROR 0#define OK 1 #define ElemType char#define N 10#define STACK_INIT_SIZE 100#define STACKINCERMENT 10typedef int status;typedef struct{ ElemType *top; El...原创 2018-04-25 09:56:41 · 158 阅读 · 0 评论 -
【数据结构与算法】栈的应用-二进制转八进制
#include <stdio.h>#define ERROR 0#define OK 1 #define ElemType char#define N 10#define STACK_INIT_SIZE 100#define STACKINCERMENT 10typedef int status;typedef struct{ ElemType *top; El...原创 2018-04-24 20:15:02 · 1078 阅读 · 0 评论 -
【数据结构与算法】双向链表-维吉尼亚加密
#include <stdio.h>#include <string.h> #define ERROR 0#define OK 1 #define ElemType char#define N 26typedef int status;typedef struct Node{ ElemType data; struct Node* perior; st...原创 2018-04-19 16:49:40 · 345 阅读 · 0 评论 -
【数据结构与算法】循环链表-约瑟夫问题
只是在单链表的程序上更改了生成链表,遍历链表和约瑟夫问题,其他部分功能程序代码还没有更改。但可以使用#include <stdio.h>#define ERROR 0#define OK 1 #define ElemType int#define N 10typedef int status;typedef struct Node{ ElemType data; st...原创 2018-04-18 21:23:45 · 180 阅读 · 0 评论 -
【数据结构与算法】循环链表-拉丁矩阵
自己码的代码虽然简单,但是基本上已经可以不看代码写出链表各种操作了。需要注意的是生成的循环链表去掉了头结点,从第一个有数据的结点开始,然后返回时需要将头结点地址返回,否则无法正常进行接下来的链表操作。如果不将头结点删除,那么就可以直接在原有链表上继续进行操作,但是相比之下没有删除之后方便,因为每次遍历完跳回到头结点时,又需要将头结点跳过,因为头结点里并未保存数据,之前做的约瑟夫问题就是这样,增加了...原创 2018-04-18 21:18:19 · 207 阅读 · 0 评论 -
二叉树所有遍历
#include "stdafx.h"#include<iostream>#include<stack>#include<queue>using namespace std;typedef struct BtreeNode{ int value; struct BtreeNode *lchild, *rchild;}BtreeNode;t...原创 2018-09-02 15:48:05 · 288 阅读 · 0 评论