![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 71
CHENCHWT
这个作者很懒,什么都没留下…
展开
-
实验 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-03 13:18:00 · 467 阅读 · 0 评论 -
十进制转二进制
#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-04-27 17:13:55 · 183 阅读 · 0 评论 -
二叉树链表存储结构
#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-05-17 21:44:59 · 707 阅读 · 0 评论 -
链栈
#include <iostream> using namespace std; template<class DataType> struct Node { DataType data; Node<DataType>*next; }; template<class DataType&...原创 2018-04-26 21:46:44 · 151 阅读 · 0 评论 -
顺序队列
#include <iostream> using namespace std; const int QueueSize=100; template<class DataType> class CirQueue { public: CirQueue(){front=rear=QueueSize-1;}...原创 2018-04-26 21:37:27 · 162 阅读 · 0 评论 -
链队列实验
#ifndef Linkqueue_H#define Linkqueue_Htemplate<class datatype>struct Node{datatype data;Node<datatype>*next;};template<class datatype>class Linkqueue {public:Linkqueue();~Linkqueue()...原创 2018-04-25 21:51:55 · 673 阅读 · 0 评论 -
二叉树实验
确定一个二叉树,利用顺序结构存储,实现树的构造;并层序输出点数据;输出各个结点双亲和孩子信息;输出所有叶子信息。#include<iostream>using namespace std;#include<string.h>const int M=100;class tree{public:tree(){length=0;} void create(); //建立二叉树v...原创 2018-05-09 22:16:25 · 523 阅读 · 0 评论 -
间接寻址建立学生成绩
实验内容: 建立一个由n个学生成绩的顺序表,n的大小由自己确定,每一个学生的成绩信息由自己确定,实现数据的对表进行插入、删除、查找等操作。分别输出结果。 代码:#include<iostream> using namespace std; const int M=10; struct Node { int data; }; class Student{ ...原创 2018-05-02 21:23:45 · 156 阅读 · 0 评论 -
静态链表建立学生成绩
实验内容: 建立一个由n个学生成绩的顺序表,n的大小由自己确定,每一个学生的成绩信息由自己确定,实现数据的对表进行插入、删除、查找等操作。分别输出结果。 代码:#include <iostream>using namespace std; const int M=100; struct SNode { int data; int nex...原创 2018-05-02 17:46:49 · 475 阅读 · 0 评论 -
顺序表实验
#ifndef SeqStack_H#define SeqStack_H const int StackSize=100; template<class DataType> class SeqStack { public: SeqStack(); ~SeqStack(){}; void Push(D...原创 2018-04-24 20:19:09 · 303 阅读 · 0 评论 -
总结线性表的几种主要存储结构
1.顺序表:线性表的顺序存储结构称为顺序表,是用一段地址连续的存储单元依次存储数据元素的,通常用一维数组来实现。顺序表的中数据元素之间的逻辑关系是用存储位置表示的,顺序表是随机存取结构。在顺序表上实现插入和删除操作,在等概率情况下,平均要移动表中元素的一半,算法的平均时间复杂度为O(n)。顺序表的优点是:无需为表示表中元素之间的逻辑关系而增加额外的存储空间;随机存取。顺序表的缺点是:插入和删除操作...原创 2018-04-30 14:20:16 · 6923 阅读 · 0 评论 -
双链表建立学生成绩
#include <iostream>using namespace std; const int M=100; struct Node { int data; Node *next,*prior; };class LinkList { public: LinkList(); ...原创 2018-04-30 13:33:41 · 302 阅读 · 0 评论 -
单链表建立学生成绩
#include <iostream>using namespace std; const int M=100; struct Node { int data; Node *next; };class LinkList { public: LinkList(); Link...原创 2018-04-30 12:13:52 · 1733 阅读 · 0 评论 -
顺序表建立学生成绩
建立一个由 n 个学生成绩的顺序表,n 的大小由自己确定,每一个学生的成绩信息由自己确定,实现数据的对表进行插入、删除、查找等操作。分别输出结果#include<iostream> using namespace std; const int MaxSize=100; class SeqList { public: SeqList(){length=0;...原创 2018-04-30 11:57:07 · 4079 阅读 · 1 评论 -
实验一顺序表
#include<iostream>using namespace std;#ifndef SeqList_H#define SeqList_Hconst int MaxSize=10;class SeqList{public: SeqList(){length=0;} SeqList(int a[],int n);...原创 2018-04-04 15:29:26 · 301 阅读 · 0 评论 -
201711671103《Java程序设计》第五周学习总结
教材学习内容总结1.面向对象语言特性:封装性,继承和多态;2.类是java程序的基本要素,一个源文件由若干个类组成,类定义包括类声明和类体,格式为:class 类名{类体内容}类体中由成员变量的声明和方法的定义组成,当类名由几个单词复合成时,每个单词的首字母要大写。3.变量和方法命名:名字的首单词的首字母用小写,如果名字由多个单词构成,从第二个档次开始的其他单词的首字母用大写。...原创 2018-10-14 11:28:41 · 210 阅读 · 0 评论