Introduction to Abstract Data Types Flashcards
Abstract Data Type
a data type described by predefined user operations
List
ADT for holding ordered data
Dynamic Array
ADT for holding ordered data and allowing indexed access
Stack
ADT in which items are only inserted on or removed from the top of a stack
last in, first out
Queue
ADT in which items are inserted at the end of the queue and removed from the front of the queue
Deque
ADT in which items can be inserted and removed at both the front and back
Bag
ADT for storing items in which the order does not matter and duplicate items are allowed
Set
ADT for a collection of distinct items
Priority Queue
A queue where each item has a priority, and items with higher priority are closer to the front of the queue than items with lower priority
Dictionary (Map)
ADT that associates (or maps) keys with values
Python’s Common Supported ADTs
list, set, dict, queue
C++’s Common Supported ADTs
vector, list, deque, queue, stack, set, map
Java’s Common Supported ADTs
Collection, Set, List, Map, Queue, Deque
realloc definition
re-allocates an original pointer’s memory block to be the newly-specified size (either increase or decrease)
realloc function
(type)realloc(pointerVariable, numElementssizeof(type));
dynamic set
set that can change after being constructed
information hiding
Internal implementation of the data and operations are hidden from the ADT user