
南邮实验
yi把菜刀
菜狗一枚,多多包涵
展开
-
南邮实验4(1~4题综合)各种排序算法和时间的计算
运行结果源文件#include"堆排序的堆栈.h"//简单排序法//在startIndex至表尾范围内找到最小关键字的下标元素int FindMin(List list, int startIndex){ int i, minIndex = startIndex; for (i = startIndex+1; i < list.n; i++) { if (list.D[i].key < list.D[minIndex].key) { minIndex =原创 2021-05-10 18:50:15 · 2158 阅读 · 7 评论 -
数据结构实验3--图以邻接表为存储结构的初始化,遍历,迪杰斯特拉算法求最短路径(实验内容3~4~5)
运行结果:源文件:#include "邻接表宽度优先遍历的queue.h"//邻接表的初始化Status Init(LGraph* lg, int nSize){ int i; lg->numofDot = nSize; lg->numofEdge = 0; lg->a = (ENode**)malloc(nSize * sizeof(ENode*)); if (!lg->a) { return ERROR; } else { for (i =原创 2021-04-28 12:28:09 · 571 阅读 · 1 评论 -
数据结构实验3--图以邻接矩阵为存储结构的初始化,遍历,迪杰斯特拉算法求最短路径(实验内容1~2,5)
运行结果:源文件:#include "邻接矩阵宽度优先遍历的queue.h"//邻接矩阵的初始化Status Init(MGraph* mg, int nSize, ElemType noEdgeValue){ int i, j; mg->numofDot = nSize; mg->numofEdg = 0; mg->noEdge = noEdgeValue; mg->a = (ElemType**)malloc(nSize * sizeof(ElemType原创 2021-04-28 12:24:10 · 689 阅读 · 0 评论 -
数据结构顺序表的初始化,删除,增加元素等操作c语言
我们学校实验之一,对你有用可自提#include<stdio.h>#include<stdlib.h>#include<string.h>#define ERROR 0#define OK 1#define Overflow 2#define Underflow 3#define NotProsent 4#define Duplicate 5typedef int ElemType;typedef struct seqList{ int n;原创 2021-03-15 13:44:50 · 489 阅读 · 1 评论 -
带表头节点一元多项式的初始化,撤销,相加和相乘操作代码实现c语言
有需求者可自提#include<stdio.h>#include<stdlib.h>#include<string.h>typedef struct Node { int coef; int exp; struct Node* next;}Node,*LinkList;typedef struct Head { LinkList head;}Head;void Insert(LinkList Head, int coef, int exp) //原创 2021-03-15 13:54:06 · 1018 阅读 · 3 评论 -
数据结构链表初始化,插入或删除某节点,逆置,按升降序排序等c语言
有需求者可自提代码#include<stdio.h>#include<stdlib.h>#include<string.h>#define ERROR 0#define OK 1#define Overflow 2#define Underflow 3#define NotProsent 4#define Duplicate 5typedef int ElemType;typedef struct seqList{ int n; int ma原创 2021-03-15 13:48:56 · 221 阅读 · 0 评论 -
二叉树的先序创建递归遍历和非递归遍历和求叶子结点和树的高度等操作c语言
效果图如下下面为内容:源文件:#include "层次遍历的Queue.h"#include "非递归算法的堆栈.h"void Create(BinaryTree* bt) //构造一棵空的二叉树{ bt->root = NULL;}BTNode* NewNode(ElemType x, BTNode* ln, BTNode* rn) //创造一个新的节点{ BTNode* p = (BTNode*)malloc(sizeof(BTNode)); p->e原创 2021-04-11 22:17:14 · 492 阅读 · 0 评论 -
哈夫曼树的创建和编码和译码和压缩(根据编码文件进行译码),压缩等操作c语言
源文件:#include "优先权队列.h"#include "哈夫曼的stack.h"//构造一棵空的二叉树void Create(BinaryTree* bt) { bt->root = NULL;}HFMTNode* NewBTNode(ElemType w, HFMTNode* lC, HFMTNode* rC){ HFMTNode* p = (HFMTNode*)malloc(sizeof(HFMTNode)); p->w = w; p->lChil原创 2021-04-11 20:45:27 · 2208 阅读 · 8 评论 -
南邮c++实验一
第一问:#include<iostream>#include<string>using namespace std;class BookCard{private: string id; string stuName; int number;public: BookCard(string i,string s,int n); BookCard(const BookCard & per); BookCard(); void dispaly(); bo原创 2020-12-09 01:06:04 · 542 阅读 · 0 评论 -
南邮c++实验三 容器类的V和S 问题代码
#include<iostream>using namespace std;const double PI = 3.14156;class Container{protected: double radius;public: Container(double r) { radius = r; } virtual double area() = 0; virtual double volume() = 0; virtual void print() = 0;};c原创 2020-12-09 01:02:21 · 257 阅读 · 0 评论 -
南邮c++实验四 文件中选课和选课人数问题 代码
南邮c++实验 文件中选课和选课人数问题 代码#include<fstream>#include<iostream>#include<string>#include<iomanip>using namespace std;class Course{ string name; int number;public: Course(string na = "", int num = 0); friend ostream& operat原创 2020-12-09 00:56:31 · 250 阅读 · 0 评论 -
南邮c++实验工资管理问题 代码
南邮c++实验工资管理问题 代码#include<iostream>#include<string>using namespace std;class Employee{protected: string name; //姓名 int working_years; //工龄public: Employee(string nm = "unnamed", int wy = 0); string Getname(); double ComputePay();原创 2020-12-09 00:51:45 · 244 阅读 · 0 评论 -
南邮c++实验二 车类继承问题
c++车类继承问题#include<iostream>#include<string>using namespace std;class Vehicle{protected: int MaxSpeed; int Weight;public: Vehicle(int m, int w) { MaxSpeed = m; Weight = w; cout << "Constructing Vehicle...\n"; } ~Vehicle原创 2020-12-09 00:49:21 · 774 阅读 · 0 评论