[Data Structure] – Stack and Queue

Stacks and queues are special linear tables, which are expressed in basic operations and are a subset of linear table operations. Limited linear table. The stack is last in first out, and the queue is first in first out. Both stack and queue operations can be implemented in sequential storage and chain storage.


Stack

Queue

< span style="font-family:SimSun; font-size:18px">
< img src="/wp-content/uploadshttp:/img.voidcn.com/vcimg/static/loading.png" alt="" d="5500292" s="285_2ec" t="jpg">
< /span>


Summary

The difference between the stack and the queue lies in the different data operation methods brought about by the difference in the structure. The stack is last in first out, and the queue is first in first out. Sequential realization and chain realization of different structure realization algorithms.



The difference between stack and queue is Different structures bring about different data operation modes. Stack last in, first out, queue first in first out, stack and queue are implemented in sequence and chained to implement the implementation algorithms of different structures.

Leave a Comment

Your email address will not be published.