![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
夜雨时’
好好学习进大厂
展开
-
数据结构-------图的相关操作(关键路径)
#include<iostream> #define MAXSIZE 100 #define MAXINT 37267 using namespace std; typedef struct { char vex[MAXSIZE]; int arcs[MAXSIZE][MAXSIZE]; int vexnum,arcnum; }AMGraph; int LocateVex(AMGraph G,char v) { for(int i=0;i<G.vexnum;i++) { .原创 2021-11-21 23:30:54 · 652 阅读 · 0 评论 -
数据结构------图的基本操作(普里姆算法实现最小生成树)
#include<iostream> #define MAXSIZE 100 #define MAXINT 37267 using namespace std; typedef struct { char vex[MAXSIZE]; int arcs[MAXSIZE][MAXSIZE]; int vexnum,arcnum; }AMGraph; struct { char adjvex; int lowcost; }closedge[MAXSIZE]; int LocateVex.原创 2021-11-19 10:21:48 · 1036 阅读 · 0 评论 -
数据结构----图的相关操作(广度搜索)
#include<iostream> #define MAXSIZE 100 using namespace std; typedef struct ArcNode { int adjvex; struct ArcNode *next; int info; }ArcNode; typedef struct VNode { char data; ArcNode *firsstarc; }VNode,AdjList[MAXSIZE]; typedef struct { AdjLis.原创 2021-11-15 12:45:55 · 711 阅读 · 0 评论 -
数据结构--------图的创建及基本操作(深度遍历)
#include<iostream> #define MAXSIZE 100 using namespace std; typedef struct ArcNode { int adjvex; struct ArcNode *next; int info; }ArcNode; typedef struct VNode { char data; ArcNode *firsstarc; }VNode,AdjList[MAXSIZE]; typedef struct { AdjLis.原创 2021-11-14 22:14:13 · 1143 阅读 · 0 评论 -
数据结构--------数和二叉树(哈夫曼树的创建)
#include<iostream> using namespace std; typedef struct HTNode { int weight; int parent,lchild,rchild; }HTNode; void Select(HTNode *&HT,int a,int &s1,int &s2) { s1=1; int temp; while(s1<=a) { if(HT[s1].parent==0) { break;.原创 2021-10-20 15:41:03 · 116 阅读 · 0 评论 -
数据结构-----------树和二叉树(线索二叉树)
#include<iostream> using namespace std; typedef struct BiTreeNode { char data; struct BiTreeNode *lchild; struct BiTreeNode *rchild; int LTag,RTag; }BiTree; BiTree *pre; void CreatNode1(BiTree *&T) //先序遍历建立二叉链表 { char ch; cin>>ch.原创 2021-10-17 23:40:41 · 65 阅读 · 0 评论 -
数据结构----------树和二叉树
#include<iostream> using namespace std; typedef struct BiTNode { char data; struct BiTNode *lchild; struct BiTNode *rchild; }BiTree; void CreatNode1(BiTree *&T) //先序遍历建立二叉链表 { char ch; cin>>ch; if(ch=='#') T=NULL; else { T=n.原创 2021-10-14 21:30:01 · 79 阅读 · 0 评论 -
数据结构---栈的表达式求解
#include<iostream> using namespace std; #define MAXSIZE 100 typedef struct { char *base; char *top; int size; }Stack; typedef struct { int *base; int *top; int size; }Stack1; bool creatStack(Stack &S) { S.base=new char[MAXSIZE]; if(!S.原创 2021-10-06 19:14:49 · 183 阅读 · 0 评论 -
数据结构-----------舞伴问题
#include<iostream> #define MAXSIZE 20 using namespace std; typedef struct { char name[20]; char sex; }Person; typedef struct { Person *base; int front; int rear; }Queue; void creatQueue(Queue &Q) { Q.base=new Person[MAXSIZE]; Q.front=Q.r.原创 2021-10-05 23:19:27 · 404 阅读 · 1 评论 -
数据结构栈和队列-------------链队列的相关的操作
#include<iostream> using namespace std; typedef struct Node { int data; struct Node *next; }QNode; typedef struct { QNode *front; QNode *rear; }LinkQueue; void creatQueue(LinkQueue &Q) { Q.front=Q.rear=new QNode; Q.front->next=NULL;.原创 2021-10-02 23:30:55 · 63 阅读 · 0 评论 -
数据结构栈和队列--------------顺序队列的相关操作
#include<iostream> #define MAXSIZE 6 using namespace std; typedef struct { int *base; int rear; int front; }Queue; void InitQueue(Queue &Q) { Q.base=new int[MAXSIZE]; Q.front=0; Q.rear=0; return; } int lengthQueue(Queue Q) { return(Q.原创 2021-09-29 23:06:51 · 70 阅读 · 0 评论 -
数据结构--------------顺序栈和链表栈相关操作
#include<iostream> #define MAXSIZE 100 using namespace std; typedef struct { int *base; int *top; int stacksize; }Stack; bool InitStack(Stack &S) { S.base=new int[MAXSIZE]; if(!S.base) return false; S.top=S.base; S.stacksize=MAXSIZE;.原创 2021-09-28 19:24:40 · 66 阅读 · 0 评论 -
数据结构线性表实例-----------图书信息管理系统
#include<iostream> #include<string> using namespace std; typedef struct book { int ISBN; string name; float price; }Book; typedef struct Node { Book data; struct Node *next; }LNode; void creatList(LNode *&L) { L=new LNode; L->n.原创 2021-09-26 21:47:09 · 2213 阅读 · 1 评论 -
数据结构线性表实例-------------多项式的合并
#include<iostream> using namespace std; typedef struct Node { float coef; //系数 int expn; //指数 struct Node *next; }LNode; void createList(LNode *&L,int n) { L=new LNode; L->next=NULL; for(int i=0;i<n;i++) { LNode *.原创 2021-09-25 13:47:51 · 484 阅读 · 0 评论 -
数据结构--------单链表的合并
#include<iostream> using namespace std; #define MAXSIZE 100 typedef struct Node { int data; struct Node *next; }LNode; void creatList(LNode *&L) { L=new LNode; L->next=NULL; } void inputList(LNode *&L,int n) { int i=0; LNode *cp.原创 2021-09-24 11:13:03 · 4218 阅读 · 0 评论 -
数据结构--------顺序表的合并
#include<iostream> using namespace std; #define MAXSIZE 100 typedef struct node { int *elem; int length; }List; void creatList(List &L) { L.elem=new int[MAXSIZE]; L.length=0; return; } void inputList(List &L,int n) { int i=0; for(.原创 2021-09-24 08:56:02 · 458 阅读 · 0 评论 -
数据结构单链表的创建插入及相关操作
#include<iostream> using namespace std; #define MAXSIZE 100 typedef struct Node { int data; struct Node *next; }LNode; void creatList(LNode *&L) { L=new LNode; L->next=NULL; } void inputList(LNode *&L,int n) { int i=0; for(i;i&l.原创 2021-09-23 21:16:49 · 335 阅读 · 0 评论 -
数据结构顺序链表的创建插入及相关操作
#include<iostream> using namespace std; #define MAXSIZE 100 #define ERROR 0 typedef struct { int *elem; int length; }List; void creatList(List &L) { L.elem=new int[MAXSIZE]; L.length=0; return; } void inputList(List &L,int n) { int.原创 2021-09-23 21:07:15 · 249 阅读 · 0 评论