We can create any class we like with Object Oriented programming languages like Python. Using python you can use things like lists to create Abstract Data Types like Queues and Stacks.
A queue is an ADT or container that is first in first out.
A queue is like a line at the grocery store.
The first person in line at the register will be the first person who is serviced and out the door.

We also learned about Stacks where a stack is an ADT or container that is first in last out.
A Stack is like a pile of papers.
If you are given a stack of papers one at a time and lay them on a table one on top of the other.
The first page that was put in if you choose to look at each paper from top to bottom will be the last one marked and the last person to get their work back.
No comments:
Post a Comment