![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 68
在读硕士的橘仔
这个作者很懒,什么都没留下…
展开
-
实验一
#include<iostream>using namespace std;#ifndef SeqList_H#define SeqList_Hconst int MaxSize=10;class SeqList{public: SeqList(){length=0;} SeqList(inta[],int n); ~SeqList(){} ...原创 2018-04-01 10:32:04 · 376 阅读 · 0 评论 -
实验五 前序中序后序遍历输出结点信息(链式)
#include<iostream.h>struct BiNode{ char data; BiNode *lchild,*rchild;};class BiTree{public: BiTree(){root=Create(root);} ~BiTree(){Release(root);} void Preorder(){Preorder(root);} void Inorder()...原创 2018-05-18 21:38:27 · 345 阅读 · 0 评论 -
层序输出结点数据(链表)
#include<iostream.h> #include<stdlib.h>typedef struct BiNode{ char data; BiNode *lchild,*rchild;} *BiTree;BiTree queue[100]; //队列当中存的是指向结构体的指针,而不是通常的整形或字符型的数据。int front,rear;BiTree C...原创 2018-05-06 13:45:01 · 216 阅读 · 0 评论 -
实验四 二叉树层序输出结点信息(顺序存储)
#include<iostream>#include<string>#define MaxSize 5using namespace std;class BiTree{public: BiTree(); void leverOrder(); static int count;private: string array[100]; };int BiTree::count=...原创 2018-05-19 16:48:45 · 452 阅读 · 0 评论 -
实验三 单链表实现学生成绩系统
#include<iostream>using namespace std;//template<class DataType>typedef int DataType;struct Node{ DataType data; struct Node *next;};//template<class DataType>class Linklist{ public:...原创 2018-04-28 22:55:26 · 595 阅读 · 0 评论 -
实验三 双链表实现学生成绩系统
#include<iostream>using namespace std;//template<class DataType>typedef int DataType;struct DouNode{ DataType data; struct DouNode * prior,* next;};//template<class DataType>class Li...原创 2018-04-28 22:56:38 · 334 阅读 · 0 评论 -
实验三 静态链表实现学生成绩系统
#include<iostream.h>#include<stdlib.h>typedef int ElemType;typedef int DataType;const int MaxSize=100;typedef struct{ ElemType data; int cur;}SLinkList [MaxSize]; class SLink{public: void ...原创 2018-04-28 22:57:21 · 254 阅读 · 0 评论 -
实验五 输出各个结点和双亲、孩子的结点信息(链表)(转载)
#define CHAR /* 字符型 */ #include<stdio.h> /* EOF(=^Z或F6),NULL */ #include<math.h> /* floor(),ceil(),abs() */ #include <stdlib.h> #define TRUE 1 #define FALSE 0 #define OK 1 #de...转载 2018-05-07 21:50:30 · 1688 阅读 · 1 评论 -
实验六 图的邻接矩阵存储实现
#include<iostream.h>const int Maxsize=6;const int Max_Edge=6;int visited[Maxsize]={0};struct ArcNode{ int adjvex; ArcNode *nextarc; //指向下一条弧};struct Vnode{ int v; //顶点信息 ArcNode *next;}a[M...原创 2018-05-26 15:02:51 · 458 阅读 · 0 评论 -
实验五 输出叶子结点(链式)
#include<iostream.h>#include<malloc.h>typedef struct BiNode{ char data; struct BiNode *lchild,*rchild;}BiNode,*BiTree;void createBiTree(BiTree &T);void DisDeaf(BiTree T);void createBiT...原创 2018-05-18 21:30:00 · 442 阅读 · 0 评论 -
实验三 顺序表实现学生成绩系统
#include<iostream>using namespace std;class Student{private: char *name[5]; int length; float grade[5];public: Student(){length=0;} Student(char *n[],float g[],int l); ~Student(){} void insert(c...原创 2018-04-27 22:02:32 · 829 阅读 · 0 评论 -
实验三 总结线性表的几种主要存储结构
1、顺序表:顺序表是一段地址连续的存储单元依次存储线性表的数据元素,一般用一维数组实现,这是与链表的不同之处。顺序表中数据元素之间的逻辑关系是用存储位置表示的,顺序表的随机存取结构。因为是选择用数组实现,所以要分配固定长度的数组空间,这样便限制了元素的数量,也容易浪费存储空间。但同时,其存储结构也使得寻找下一个元素会较为方便。顺序表优点在于,无需为表示表中元素之间的逻辑关系而增加额外的存储空间:随...原创 2018-05-01 15:40:18 · 503 阅读 · 0 评论 -
实验三 间接寻址实现学生成绩
#include<iostream> using namespace std; const int M=100; typedef int DataType;struct Node{ DataType data;}; class Listlink { public: Listlink(); Listlink(int a[...原创 2018-05-01 16:39:46 · 223 阅读 · 0 评论 -
实验二 顺序栈
#include<iostream>using namespace std;const int StackSize=10;class SeqStack{public: SeqStack(){top=-1;} ~SeqStack(){} void Push(int x); int Pop(); int GetTop() {if(top!=-1) return data[top];} in...原创 2018-04-25 16:42:35 · 179 阅读 · 0 评论 -
实验二 链栈
#include<iostream.h>struct Node{ int data; struct Node *next;};class Linkstack{private: Node *top;public: Linkstack(); ~Linkstack(){} void push(int x); int get(); int pop();};Linkstack::Linkstac...原创 2018-04-25 16:43:42 · 203 阅读 · 0 评论 -
实验二 顺序队列
#include<iostream>using namespace std;const int QueueSize=100;class CirQueue{public: CirQueue() { front=rear=QueueSize-1; } ~CirQueue(){} void EnQueue(int x); int DeQueue(); int GetQueue(); int...原创 2018-04-25 16:44:49 · 167 阅读 · 0 评论 -
实验二 链队列
#include<iostream>using namespace std;struct Node{ int data; Node *next;};class LinkQueue{public: LinkQueue(); ~LinkQueue(); void EnQueue(int x); int DeQueue(); int GetQueue(); int Empty();priva...原创 2018-04-25 16:45:46 · 246 阅读 · 0 评论 -
实验二 实现十进制转化为二进制
#include<iostream>using namespace std;const int StackSize=100;class SeqStack{public: SeqStack(){top=-1;} ~SeqStack(){} int Empty(); int data[StackSize]; int top;};int main(){ int x; SeqStack s;...原创 2018-04-25 17:02:11 · 447 阅读 · 0 评论 -
实验二 *学生打饭系统
#include<iostream>using namespace std;const int QueueSize=100;class CirQueue{public: CirQueue() { front=rear=QueueSize-1; } ~CirQueue(){} void EnQueue(char *x); char * DeQueue(); // char * Ge...原创 2018-04-25 23:14:21 · 360 阅读 · 0 评论 -
哈夫曼编码解码(转载)
#include <stdlib.h>#include <stdio.h>#include <malloc.h>#include <string.h>#include <ctype.h>#define MAX 999999 //一个极大值#define NUM 10//存储哈夫曼树每个结点typedef struct Node { ...转载 2018-05-23 21:24:01 · 1016 阅读 · 1 评论