- 博客(13)
- 收藏
- 关注
原创 实验6:图的实验
#include<iostream> #include<iomanip> #include<string> using namespace std; const Size = 10;class MGraph{ public: MGraph(string a[],int n,int e); ~MGraph(){}; void...
2018-06-17 18:02:02
322
原创 二叉树的链式存储结构存储,实现树的构造
#include<iostream>using namespace std;struct binode{char data;binode *lchild,*rchild;};class tree{public:tree(){root=creat(root);}~tree(){release(root);}void preorder(){preorder(root);}void inor...
2018-06-17 18:01:22
2916
原创 实验五:树和二叉树的实验
确定一个二叉树,利用顺序结构存储,实现树的构造;并层序输出点数据;输出各个结点双亲和孩子信息;输出所有叶子信息。#include<iostream>using namespace std;#include<string.h>const int M=100;class tree{public:tree(){length=0;} void create(); //建立二叉树v...
2018-06-17 18:00:00
353
原创 间接寻址来记录学生成绩
#include<iostream> using namespace std; const int M=10; struct Node { int data; }; class Student{ public: Student(); Student(int a[],int n); ~Student(); void Input...
2018-06-17 17:58:33
216
原创 静态链表来表示学生成绩
#include <iostream>using namespace std; const int M=100; struct SNode { int data; int next; }SList[M];class Student { public: Student(); Stude...
2018-06-17 17:57:15
222
原创 用双链表来记录学生成绩信息
#include <iostream>using namespace std; const int M=100; struct Node { int data; Node *next,*prior; };class LinkList { public: LinkList(); ...
2018-06-17 17:56:24
501
原创 单链表来记录学生成绩信息
#include <iostream>using namespace std; const int M=100; struct Node { int data; Node *next; };class LinkList { public: LinkList(); Link...
2018-06-17 17:55:46
1857
原创 用顺序表来存储学生的成绩信息实现一系列的功能
建立一个由 n 个学生成绩的顺序表,n 的大小由自己确定,每一个学生的成绩信息由自己确定,实现数据的对表进行插入、删除、查找等操作。分别输出结果#include<iostream> using namespace std; const int MaxSize=100; class SeqList { public: SeqList(){length=0;...
2018-06-17 17:53:02
5099
原创 十进制转化为二进制
#include<iostream>using namespace std;#define M 10int main(){int n;cout<<"请输入一个十进制数:"<<endl;cin>>n;int h=0,b,k=1;while(n!=0){ b=n%2; k = k*10; n=n/2; h=k * b + ...
2018-06-17 17:49:18
360
原创 顺序队列以及链队列(实验2T1)
顺序队列:#include <iostream> using namespace std; const int QueueSize=100; template<class DataType> class CirQueue { public: CirQueue(){front=rear=QueueSiz...
2018-05-05 10:52:18
238
原创 顺序栈和链栈的压栈以及出栈(实验2T1)
顺序栈:#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];...
2018-05-05 10:25:58
358
原创 十进制转为二进制(实验2T2)
#include <iostream>using namespace std;#define M 10int main (){ int n; cout<<"请输入一个10进制数:"<<endl; cin>>n; int h=0,b,k=1; while(n!=0) { b=n%2; k=k*10; n=n/2; h=k*b+h; } cout...
2018-05-05 10:08:09
369
原创 信管117206高颖数据结构实验一
#ifndef SeqList_H#define SeqList_Hconst int MaxSize=10;class SeqList {public: SeqList(){length=0;} SeqList(int a[],int n); ~SeqList(){} void Insert(int i,int x); int Delete(int i); i...
2018-04-01 23:35:07
310
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人