CUNY Tech Prep 2016-2017
- Stacks
- are an abstract data type that serves as an ordered collection of elements. It provides two primary operations,
push(x)
to insert elements into the collection, andpop()
to remove the most recently inserted element from the collection. This a LIFO (Last In, First Out) collection data type.
- are an abstract data type that serves as an ordered collection of elements. It provides two primary operations,
- Queues
- are an abstract data type that serves as an ordered collection of elements. It provides two primary operations,
add(x)
to insert elements into the collection, andremove()
to remove the first-most inserted element from the collection. This a FIFO (First In, First Out) collection data type.
- are an abstract data type that serves as an ordered collection of elements. It provides two primary operations,
- Sets
- are an abstract data type that serves as an unordered collection of elements. It provides two primary operations,
add(x)
to insert elements into the collection, andremove(x)
to remove specific elements. The collection keeps only unique element values, discarding duplicate entries.
- are an abstract data type that serves as an unordered collection of elements. It provides two primary operations,
Videos:
- Stacks and Queues, by DerekBanas (16min)
- Stacks and Queues, by BlondieBytes (27min)
Textbook:
Additional Resources:
- When do you use a Stack vs a Queue?
- Stacks and Queues are simply interfaces to abstract concepts. Both Stacks and Queues can be implemented with either Arrays or LinkedLists. In each case, there are pros and cons. For each, the stack and queue, compare the pros and cons of implementing it with Arrays vs LinkedLists.
- What are the different ways we can implement a Set?