multiple columns of multiple rows of multiple mailboxes (left/right & up/down & forward/backward)
πͺπͺπͺπͺπͺπͺ
πͺπͺπͺπͺπͺπͺ
Stacks and Queuesππ
Stacks and queues are examples of 1D arrays.
Stacks π₯π‘π
The stack is exactly as it sounds, items stacked on top of each other. Adding and removing items always occur with top of the stack.
Stack
The vertical array utilizes the L.I.F.O. (Last In First Out) principal, which is the last item to go in the stack is the first item to get out of the stack.
Removal -> top of the stack
Adding -> top of the stack
Example: pringles, dishes, zen rock stacking
Queues ππΆπΆββοΈπΆββοΈ
The Queue is the same as a line. Adding items occurs at the beginning of the queue and removing items occurs at the end of the queue.
Queue
The horizontal array uses the F.I.F.O. principal (First In First Out) which is the first person to get in line is the first person to get out of the line, F.I.F.O.
Removal -> The end of an array
Adding -> the beginning of the array
Example: a line for fast food, a line for a new Iphone, a line at Disneyland