MindMap Gallery Data structure-3.1. Stack
This is an article about data structure-3.1. Stack mind map, which only allows insertion and deletion of linear tables at one end, first in, last out FILO.
Edited at 2023-11-27 15:48:38One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
Project management is the process of applying specialized knowledge, skills, tools, and methods to project activities so that the project can achieve or exceed the set needs and expectations within the constraints of limited resources. This diagram provides a comprehensive overview of the 8 components of the project management process and can be used as a generic template for direct application.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
Project management is the process of applying specialized knowledge, skills, tools, and methods to project activities so that the project can achieve or exceed the set needs and expectations within the constraints of limited resources. This diagram provides a comprehensive overview of the 8 components of the project management process and can be used as a generic template for direct application.
StackStack
Definition: A linear table that only allows insertion and deletion at one end, first in, last out FILO
Properties: n elements are pushed onto the stack, and the number of different arrangements of elements popped out of the stack is (Catelan number)
storage structure
sequence stack
Basic operations
Create: S.top=-1
Pin: Since a static array is defined, the system automatically recycles it when the function call ends.
Increase: S.data[S.top]=x first move the pointer and then push it onto the stack
Delete: x=S.data[S.top--]
Check (read the top element of the stack): x=S.data[S.top]
How to judge short/full? :S.top==-1/S.top==MaxSize-1
chain stack
Stack stored in a chained manner
Method to realize
Leading node
No leading node (recommended)
In and out of the stack are performed at the head of the linked list.
Advantages: There is no stack overflow, and it is convenient for multiple stacks to share space
shared stack
S.top0==-1; S.data[ S.top]=x Push from the bottom of the stack to the top of the stack
S.top1=MaxSize;x=S.data[--S.top] Push from the top to the bottom of the stack
Full sentence: top0 1==top1