abstract data type
A description of what a collection does, such as "last in, first out", without saying how it is stored.
In more detail
A stack and a queue are abstract data types: they are defined by the order in which items leave, not by memory layout. The course calls them disciplines, and then implements each with a concrete structure such as a Python list or a deque. Separating the two lets you swap the implementation without changing the code that uses it.
Related terms
- stack — A collection where the last item added is the first one removed, like a pile of plates.
- queue — A collection where items leave in the order they arrived: first in, first out, like a line at a shop counter.
- data structure — A way of arranging data in memory, such as a list, dictionary, tree or graph, so that certain operations become cheap.
Taught in
- Linked Lists: Nodes, Pointers And Sentinels — Algorithms & Data Structures for Working Engineers
- Stacks And Queues: Last In Or First In — Algorithms & Data Structures for Working Engineers
- Breadth-First Search And Shortest Paths By Hops — Algorithms & Data Structures for Working Engineers