Resources » Articles/Knowledge Sharing » Computer & Technology

Queue Vs Stack


Posted Date: 18-May-2008  Last Updated:   Category: Computer & Technology    
Author: Member Level: Silver    Points: 1



Difference between Queue and Stack.

A Stack is a (ordered) collection of items, where all insertions are made to the end of the sequence and all deletions always are made from the end of the sequence. In principle a stack is a container of data items, from which we get data items out in reverse order compared to the order they have been put into the container. We can also said that the item that has been put last in is coming first out. That’s why a stack is also called LIFO ((Last In First Out list). We can as well say that the item, which is put first in the container is get last out (First In Last Out: FILO).
A Queue is a (ordered) collection of items , where all insertions are made to the end of the sequence and all deletions always are made from the beginning of the sequence. In principle a queue is container from which data items are retrieved out in the same order they are put in. This means that the queue is a container that preserves the order of items put there. We can also say that the item that is put last into the queue is taken last out from the queue. That’s why a queue is sometimes called LILO (Last In Last Out list). We can also say that the item which is put first into the queue is taken first out. (First In First Out: FIFO).


Did you like this resource? Share it with your friends and show your love!




Responses to "Queue Vs Stack"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Awards & Gifts
    Active Members
    TodayLast 7 Daysmore...

    ISC Technologies, Kochi - India. Copyright © All Rights Reserved.