数据结构
lukeBai
无问西东
展开
-
链栈的基本操作
#include<stdio.h> #include<stdlib.h> typedef struct linknode{ int data; struct linknode *next; }LinkStack; void InitStack(LinkStack *&s){ s=(LinkStack *)malloc(sizeof(LinkStack)); s->next=NULL; } bool StackEmpty(LinkStack原创 2021-06-10 20:59:43 · 436 阅读 · 0 评论 -
共享栈的基本操作
#include<stdio.h> #include<stdlib.h> #define MaxSize 50 typedef struct{ int data[MaxSize]; int top0; int top1; }Dstack; void InitDstack(Dstack *&s){ s=(Dstack *)malloc(sizeof(Dstack)); s->top0= -1; s->top1= Max原创 2021-06-10 20:58:52 · 390 阅读 · 0 评论 -
顺序栈的基本操作
#include<stdio.h> #include<stdlib.h> #define MaxSize 50 typedef struct{ int data[MaxSize]; int top; }SqStack; void InitStack(SqStack *&s){ s=(SqStack *)malloc(sizeof(SqStack)); s->top=-1; } bool StackEmpty(SqStack *&原创 2021-06-10 20:57:57 · 563 阅读 · 0 评论 -
单链表的各项操作
数据结构单链表的各项操作 #include<stdio.h> #include<stdlib.h> typedef struct Node{ int data; struct Node *next; }LinkNode; void CreateListF(LinkNode *&L,int a[],int n){ LinkNode *s; L=(LinkNode *)malloc(sizeof(LinkNode)); L->next原创 2021-04-13 18:16:36 · 107 阅读 · 0 评论 -
顺序表的各项操作
数据结构顺序表的各项操作 #include <stdio.h> #include <stdlib.h> #define MaxSize 20 typedef int ElemType; typedef struct{ ElemType data[MaxSize]; ElemType length; }SqList; void CreateList(SqList *&L,ElemType a[],ElemType n){ int原创 2021-04-13 18:13:46 · 105 阅读 · 0 评论