Home

Stacks, Queues, and Lists

They define which operation can be used, but not how the data is to be stored and organized.

Stack

Items are only inserted on or removed from the top.

Last in first out(LIFO) - The last item added to the collection is the first one to be taken out.

Common operations

Common use cases

Queues

Items are only inserted at the end and removed from the front.

First in first out(FIFO) - The first item added to the collection si the first one to be taken out.

Common operations

Common use cases

Lists

Common operations

Common use cases