reading-notes

code fellows reading notes

View on GitHub

Reading-Notes

Code Fellows Python 401

Read: Data Structure and Analysis - Stacks & Queues

A stack is a data structure that consists of Nodes.

Stacks

Stack image

Vocab:

Push - Nodes or items that are put into the stack are pushed Pop - Nodes or items that are removed from the stack are popped. When you attempt to pop an empty stack an exception will be raised. Top - This is the top of the stack. Peek - When you peek you will view the value of the top Node in the stack. When you attempt to peek an empty stack an exception will be raised. IsEmpty - returns true when stack is empty otherwise returns false.

Types of stacks:

FILO - First In Last Out

LIFO - Last In First Out

Queue

Queue image

Vocab:

Enqueue - Nodes or items that are added to the queue. Dequeue - Nodes or items that are removed from the queue. If called when the queue is empty an exception will be raised. Front - This is the front/first Node of the queue. Rear - This is the rear/last Node of the queue. Peek - When you peek you will view the value of the front Node in the queue. If called when the queue is empty an exception will be raised. IsEmpty - returns true when queue is empty otherwise returns false.

Types of queues:

FILO - First In Last Out

LIFO - Last In First Out

Resources

Stacks and Queues