
数据结构
有点甜的农夫山泉
这个作者很懒,什么都没留下…
展开
-
数据结构-链表基本操作
数据结构-链表基本操作代码写的比较水,为了解决超过表长的数据输进去发生的空指针问题,代码冗余太多了,但是基本功能都实现了。虽然我之前学过数据结构,但是其实跟没学过一样,算得上是重新学习了一遍。 代码 #include <iostream>#include <cstdlib>using namespace std;typedef struct LNode{ int data; struct LNode * next;}*LinkList;...原创 2021-08-25 11:12:29 · 203 阅读 · 0 评论 -
数据结构-线性表
数据结构之线性表基本操作(C++)#include <iostream>#include <cstdlib>#define LIST_INT_SIZE 100 //线性表存储空间的初始分配量#define LISTINCREMENT 10 //线性表存储空间的分配增量using namespace std;typedef struct { int *elem; //存储空间的基地址 int length; //当前线性表的长度 int li...原创 2021-08-17 14:00:57 · 139 阅读 · 0 评论 -
线性表删除最小元素,空出的位置用最后一个元素填补
线性表删除最小元素,空出的位置用最后一个元素填补题目:从顺序表中删除具有最小值的元素(假设唯一)并由函数返回被删元素的值。空出的位置由最后一个元素填补,若顺序表为空则显示出出错信息并退出运行 代码: #include <iostream>#include <cstdlib>#define MAX_LENGTH 10#define ADD_LWNGTH 10using namespace std;typedef struct { int *elem..原创 2021-08-20 10:22:35 · 863 阅读 · 0 评论