![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线性顺序存储
炸毛疯兔
这个作者很懒,什么都没留下…
展开
-
队列的顺式存储(循环队列)
front 和rear分别代表头尾指针队列的长度是(rear-front+QueueSize)%QueueSize队列Q满的判断:(Q->rear+1)%MAXSIZE==Q->front 两者位置相差为1队列Q为空的判断:Q->front==Q->rear#include<iostream>using namespace std;const int MAXSIZE=50;typedef struct { int d...原创 2021-08-01 12:19:24 · 354 阅读 · 0 评论 -
线性表顺序存储
#include<iostream>#include<stdlib.h>#include<stdio.h>typedef struct{ int data[20]; int length;}sqlist;int listlength(sqlist L) //返回线性表的长度 { return L.length;}int getelem(sqlist L,int i) //返回第i个元素的数据 { int e; if(L.le.原创 2021-07-31 09:27:53 · 49 阅读 · 0 评论