Java数据结构: 栈(Stack)和队列(Queue)总结

stack

In a LIFO data structure, the newest element added to the queue will be processed first.

Different from the queue, the stack is a LIFO data structure. Typically, the insert operation is called push in a stack. Similar to the queue, a new element is always added at the end of the stack. However, the delete operation, pop, will always remove the last element which is opposite from the queue.

posted @ 2022-06-11 05:51  kingchou007  阅读(25)  评论(0编辑  收藏  举报