数据结构
巳強
不爱敲代码
展开
-
平衡二叉树创建删除查找数据输入输出
#include<iostream> #include<stdio.h> #include<stdlib.h> using namespace std; typedef int ElementType; typedef struct AVLNode* AVLTree; struct AVLNode { ElementType data; AVLTree left; AVLTree right; int height; }; int Getheight(AVLT原创 2021-07-05 10:54:33 · 111 阅读 · 0 评论 -
2.4.2——顺序表中基本操作的实现
#include<iostream> #define MAXSIZE 100 #define Elemtype int using namespace std; //存储结构 typedef struct { Elemtype *elem; int length; }Sqlist; //初始化 int Initlist(Sqlist &L){ L.elem=new Elemtype[MAXSIZE]; if(!L.elem) return 0; L.length=0; re原创 2021-04-19 16:53:03 · 90 阅读 · 0 评论 -
3.5.3链队——队列的链式表示和实现
#include<iostream> using namespace std; typedef int QElemtype; //存储结构 typedef struct QNode{ QElemtype data; struct QNode *next; }QNode,*Queueptr; typedef struct{ Queueptr front; Queueptr rear; }Linkqueue; //初始化 int Initqueue(Linkqueue &Q){原创 2021-04-13 09:18:21 · 120 阅读 · 0 评论