View on GitHub

reading-notes

https://samahabujwaied.github.io/reading-notes/

what is Stacks

A stack (sometimes called a “push-down stack”) is an ordered collection of items where the addition of new items and the removal of existing items always takes place at the same end. … This ordering principle is sometimes called LIFO, last-in first-out

what is Queues

A queue is an ordered collection of items where the addition of new items happens at one end, called the “rear,” and the removal of existing items occurs at the other end, commonly called the “front.” As an element enters the queue it starts at the rear and makes its way toward the front

Use WHY, WHAT, HOW structure

Use a queue when you want to get things out in the order that you put them in. Use a stack when you want to get things out in the reverse order than you put them in. Use a list when you want to get anything out, regardless of when you put them in (and when you don’t want them to automatically be removed)

Tutorial / walk through an example

Create a vocabulary/definition list

Write a cheat sheet

Create a diagram / visualization / cartoon of a topic

Anthropomorphize the concepts, and write a conversation between them

A stack is an ordered list of elements where all insertions and deletions are made at the same end, whereas a queue is exactly the opposite of a stack which is open at both the ends meaning one end is used to insert data while the other to remove data

Build a map of the information