1.6 Applications of ADTs Flashcards
What does abstraction mean in the context of ADTs?
Abstraction means to have a user interact with an item at a high-level, with lower-level internal details hidden from the user.
How do ADTs support abstraction?
ADTs support abstraction by hiding the underlying implementation details and providing a well-defined set of operations for using the ADT.
What is the benefit of using abstract data types for programmers?
Using abstract data types enables programmers to focus on higher-level operations and algorithms, thus improving programmer efficiency.
What knowledge is necessary to analyze or improve the runtime efficiency of an ADT?
Knowledge of the underlying implementation is needed to analyze or improve the runtime efficiency.
What are the requirements for maintaining a list of the 5 most recently visited websites?
- Maintain list of 5 most recently visited websites
- Display websites in reverse chronological order
- For each website visited, remove oldest entry and add new website to list
What operations are available for the List ADT?
- Append
- Prepend
- Iterate in reverse
- Remove
- GetLength
What operations are available for the Queue ADT?
- Enqueue item
- Dequeue item
- Peek
- IsEmpty
- GetLength
True or False: The list ADT supports iterating through list contents in reverse order.
True
True or False: The queue ADT supports iterating through contents in reverse order.
False
Fill in the blank: To use the list (or queue) ADT, the programmer does not need to know the underlying _______.
implementation
Which ADT is the better match for the program’s requirements involving reverse iteration?
list
The list ADT can be implemented in numerous ways. True or False?
True
True or False: Different ADTs’ implementations may have different runtimes for various operations.
True
What common abstract data types are supported in the Python standard library?
- list
- set
- dict
- deque
What common abstract data types are implemented in C++ Standard Template Library (STL)?
- vector
- list
- deque
- queue
- stack
- set
- map
What common abstract data types are found in the Java Collections Framework (JCF)?
- Collection
- Set
- List
- Map
- Queue
- Deque
True or False: Python, C++, and Java all provide built-in support for a deque ADT.
True
True or False: The underlying data structure for a list ADT is the same for all programming languages.
False
True or False: ADTs are only supported in standard libraries.
False