![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
_Wyhon
I'm gonna make a change for once in my life!
It's gonna feel real good!
展开
-
数据结构_单链表的创建
1、尾插法 (1)不带头结点typedef int ElementType; typedef struct Node *List; struct Node { ElementType data; struct Node *next; }; List Create() { List ptrL = NULL, s = NULL, tail = NULL; int n; pri...原创 2018-04-27 20:15:05 · 5735 阅读 · 0 评论 -
线性表_顺序表的基本操作
#include <stdio.h> #include <stdlib.h> typedef int ElementType; #define maxSize 10 typedef struct LNode* SeList; typedef struct LNode{ ElementType data[maxSize]; int last; }LNode...原创 2018-10-05 10:37:05 · 238 阅读 · 0 评论 -
线性表_单链表的基本操作
typedef int ElementType; typedef struct LNode* LinkList; typedef struct LNode* PtrToNode; typedef struct LNode { ElementType data; PtrToNode next; } LNode; LinkList CreateLinkList(int n); ...原创 2018-10-05 10:19:54 · 278 阅读 · 0 评论 -
串的基本操作
#include<stdio.h> #include<stdlib.h> typedef struct Str{ char *ch; int length; }Str; void StrAssign(Str *s, char *t); //字符串初始化 int StrCmp(Str *s1, Str *s2); //串的比较 void...原创 2018-10-03 11:24:19 · 883 阅读 · 0 评论 -
堆
(一)优先队列和普通队列: 普通队列:先进先出的数据结构。 优先队列:元素被赋予优先级,依据优先级的大小出队,不再依照先来先服务的原则。 有几种不同的方式可以实现优先队列: 综合各种实现方式入队和出队的效果来看,使用完全二叉树实现优先队列的效率是最高的。 (二)堆 堆是一种优先队列,有两个特性: 结构性:堆是用数组表示的完全二叉树。 ...原创 2018-08-18 15:52:13 · 130 阅读 · 0 评论 -
二叉搜索树ADT
#include<stdio.h> #include<stdlib.h> typedef int ElementType; typedef struct BST { ElementType data; struct BST *left; struct BST *right; }*BST; BST BST_Insert(BST *T, Eleme...原创 2018-08-18 13:58:19 · 233 阅读 · 0 评论 -
队列的实现
#include<stdio.h> #include<stdlib.h> typedef int ElementType_Queue; typedef struct Node { ElementType_Queue data; struct Node *next; }*PtrToNode; typedef struct Queue { PtrToNode fro...原创 2018-08-13 16:39:55 · 100 阅读 · 0 评论 -
栈的实现
1. 顺序表 #include<stdio.h> #include<stdlib.h> typedef char ElementType; #define MAXSIZE 10 typedef struct Stack { ElementType data[MAXSIZE]; int top1; int top2; }*Stack; Stack Create...原创 2018-08-13 16:37:49 · 125 阅读 · 0 评论 -
普通二叉树的创建、遍历。
(一)二叉树的创建 二叉树的表现形式有三种:链表、数组、结构数组。 1.链表 #include<stdio.h> #include<stdlib.h> typedef char ElementType; typedef struct BiTree { ElementType data; struct BiTree *lChild; str...原创 2018-08-01 12:52:35 · 266 阅读 · 0 评论 -
图的基本操作_邻接矩阵
一、创建 规范方式 #include<stdio.h> #include<stdlib.h> #define INIFINITE 32768 #define FALSE 0 #define TRUE 1 typedef int Vertex; typedef int Boolean; typedef char VertexType; typedef int ...原创 2018-10-18 19:34:31 · 882 阅读 · 0 评论