“栈和队列”的版本间的差异

来自姬鸿昌的知识库
跳到导航 跳到搜索
第15行: 第15行:
  
 
=== 栈(Stack) ===
 
=== 栈(Stack) ===
[[文件:栈.png|无|缩略图|264x264像素]]
+
[[文件:栈.png|无|缩略图|264x264像素]]先进先出(FILO——first in last out)
 +
 
 +
栈顶(top):进行插入和删除操作的一端称为栈顶
 +
 
 +
栈底(bottom):固定不变,不可进行插入和删除操作
 +
 
 +
进栈/压栈:Push the Stack
 +
 
 +
出栈/退栈/弹栈:Pop the Stack

2022年9月18日 (日) 08:31的版本

https://www.bilibili.com/video/BV1hg411V7Bm?p=58

栈和队列.png


队列(Queue)

队列.png

先进先出(FIFO——first in first out)

队尾(rear)进行插入操作

队头(front)进行删除操作


栈(Stack)

栈.png

先进先出(FILO——first in last out)

栈顶(top):进行插入和删除操作的一端称为栈顶

栈底(bottom):固定不变,不可进行插入和删除操作

进栈/压栈:Push the Stack

出栈/退栈/弹栈:Pop the Stack