Skip to the content.

Home Page

Stacks and Queues

Stacks

Stacks are like stacks when talking about function calls. Stacks are a data structure mimicking an stacked set object that only allows someone to modify it by manipulating the top of the stack. You can only ever remove what is at the top of the stack, when adding things to the stack the newest item will always be at the top.

Methods of a Stack

Queues

A queue is the same as a line. The first thing that comes into the queue will be the first thing to come out.

Methods of a Queue