堆栈和队列之间的基本区别是什么? [英] what is the basic difference between stack and queue?
问题描述
栈和队列的基本区别是什么??
What is the basic difference between stack and queue??
请帮帮我,我找不到区别.
Please help me i am unable to find the difference.
如何区分堆栈和队列?
我在各种链接中搜索了答案并找到了这个答案..
I searched for the answer in various links and found this answer..
在高级编程中,
堆栈被定义为一个列表或元素序列,通过将新元素放在"现有元素的顶部"而被加长,并通过从现有元素的顶部移除元素而被缩短.它是一个 ADT[Abstract Data Type],带有push"和pop"的数学运算.
队列是一个元素序列,通过将新元素放在现有元素的后面来添加元素,并通过删除队列前面的元素来缩短元素.它是一个 ADT[抽象数据类型].在 Java、C++、Python 等编程中对这些术语的理解更多.
我可以有更详细的答案吗?请帮帮我.
Can i have an answer which is more detailed? Please help me.
推荐答案
Stack是一个 LIFO(后进先出)数据结构.维基百科的相关链接包含详细说明和示例.
Stack is a LIFO (last in first out) data structure. The associated link to wikipedia contains detailed description and examples.
队列是一种先进先出的数据结构.维基百科的相关链接包含详细说明和示例.
Queue is a FIFO (first in first out) data structure. The associated link to wikipedia contains detailed description and examples.
这篇关于堆栈和队列之间的基本区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!