
数据结构
仁兰蓝
努力成为一名程序员
展开
-
顺序栈操作的实现(最详细)
# define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<iostream> using namespace std; # define MAXSIZE 100 typedef struct SqStack{ int* base; int* top; int stacksize; } SqStack; //初始化栈 void StackInit(SqStack* ps..原创 2021-10-31 22:11:04 · 152 阅读 · 0 评论 -
数据结构链表操作的实现(超详细)
#include<iostream> using namespace std; typedef struct Node { int date; struct Node* next; }Node; //初始化 void ListInit(Node *ps) { ps = (Node*)malloc(sizeof(Node)); ps->next = NULL; if (ps == NULL) { cout << "失败..原创 2021-10-31 13:04:13 · 202 阅读 · 0 评论 -
线性表代码的实现(最详细)
顺序表的存储结构 typedef struct List { int *date; int size; int length; }L; 构造线性表 void ListInit(L* ps) { ps->date = (int*)malloc(sizeof(L) * 4); if (ps == NULL) { cout << "创建失败" << endl; } else { cout << "创建成功"原创 2021-10-30 09:44:55 · 340 阅读 · 0 评论