1.6 Applications of ADTs Flashcards

1
Q

What does abstraction mean in the context of ADTs?

A

Abstraction means to have a user interact with an item at a high-level, with lower-level internal details hidden from the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do ADTs support abstraction?

A

ADTs support abstraction by hiding the underlying implementation details and providing a well-defined set of operations for using the ADT.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the benefit of using abstract data types for programmers?

A

Using abstract data types enables programmers to focus on higher-level operations and algorithms, thus improving programmer efficiency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What knowledge is necessary to analyze or improve the runtime efficiency of an ADT?

A

Knowledge of the underlying implementation is needed to analyze or improve the runtime efficiency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the requirements for maintaining a list of the 5 most recently visited websites?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What operations are available for the List ADT?

A
  • Append
  • Prepend
  • Iterate in reverse
  • Remove
  • GetLength
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What operations are available for the Queue ADT?

A
  • Enqueue item
  • Dequeue item
  • Peek
  • IsEmpty
  • GetLength
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

True or False: The list ADT supports iterating through list contents in reverse order.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

True or False: The queue ADT supports iterating through contents in reverse order.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Fill in the blank: To use the list (or queue) ADT, the programmer does not need to know the underlying _______.

A

implementation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which ADT is the better match for the program’s requirements involving reverse iteration?

A

list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The list ADT can be implemented in numerous ways. True or False?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

True or False: Different ADTs’ implementations may have different runtimes for various operations.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What common abstract data types are supported in the Python standard library?

A
  • list
  • set
  • dict
  • deque
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What common abstract data types are implemented in C++ Standard Template Library (STL)?

A
  • vector
  • list
  • deque
  • queue
  • stack
  • set
  • map
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What common abstract data types are found in the Java Collections Framework (JCF)?

A
  • Collection
  • Set
  • List
  • Map
  • Queue
  • Deque
17
Q

True or False: Python, C++, and Java all provide built-in support for a deque ADT.

18
Q

True or False: The underlying data structure for a list ADT is the same for all programming languages.

19
Q

True or False: ADTs are only supported in standard libraries.