TEST BANK
Data Abstraction & Problem Solving with C++: Walls and Mirrors 7th Edition
by Frank Carrano, Timothy Henry
ST
U
D
YL
AB
, Table of Content
1.Data Abstraction: The Walls
2.Recursion: The Mirrors
3.Array-Based Implementations
4.Link-Based Implementations
5.Recursion as a Problem-Solving Technique
6.Stacks
7.Stack Implementations
8.Lists
9.List Implementations
10.Algorithm Efficiency
ST
11.Sorting Algorithms and Their Efficiency
12.Sorted Lists and Their Implementations
13.Queues and Priority Queues
U
14.Queue Implementations
15.Trees
16.Tree Implementations
D
17.Heaps
18.Dictionaries and Their Implementations
YL
19.Balanced Search Trees
20.Graphs
21.Processing Data in External Storage
AB
, jhgfdsa
Multiple Choice Questions
1. The specifications of an ADT’s operations indicate .
a. what the operations do
b. how to implement the operations
c. how to store the data in the ADT
d. how to carry out the operations
Answer: a.
2. Data structures are part of an ADT’s .
a. definition
b. implementation
c. specifications
d. usage
Answer: b.
ST
3. A(n) allows two modules to communicate with each other.
a. data structure
b. axiom
c. interface
d. client
Answer: c.
U
4. An ADT’s govern(s) what its operations are and what they do.
a. specifications
b. implementation
D
c. documentation
d. data structure
Answer: a.
YL
5. When each module performs one well-defined task, we say that it is .
a. loosely coupled
b. highly coupled
c. cohesive
d. not easily reused
Answer: c.
AB
6. When should an operation contract be written?
a. during analysis
b. after coding
c. at the same time as user documentation
d. when taking initial notes from client
Answer: a.
7. What information is included in the operation contract?
a. the method’s interface
b. data flow among the modules
c. assumptions about input
d. all of these
Answer: d.
8. What kind of interface contains a method if and only that method is essential to that class’s
responsibilities?
a. complete
b. minimal
iuytrewq
, jhgfdsa
c. expanded
d. compact
Answer: b.
9. What must be known about the ADT Bag in order to use it in a program?
a. how entries in the bag are represented
b. how bag operations are implemented
c. how many entries can be stored in the bag
d. the interface of the bag
Answer: d.
10. According the CRC specifications for a Bag, which of the following behaviors would not be one of the
responsibilities of the class Bag?
a. See if the bag is empty
b. See if the bag is full
c. Look at all the objects in the bag
ST
d. Count the number of times a certain object occurs in the bag
Answer: b.
11. A client program depends solely on the of the ADT.
a. data members
b. structure
U
c. implementation
d. behavior
Answer: d.
D
12. What should a programmer do before implementing a recently designed class?
a. write code that uses the class
b. check comments that document specifications
c. adjust the design when problems are discovered
YL
d. all of these
Answer: d
13. Object-oriented programming views a program as .
a. a sequence of actions
b. a collection of classes
AB
c. a group of methods
d. an interaction among objects
Answer: d.
14. An ADT’s operations are known as its .
a. axioms
b. methods
c. variables
d. interfaces
Answer: b.
15. Encapsulation combines an ADT’s data with its operations to form a(n) .
a. exception
b. method
c. object
d. variable
Answer: c.
16. A(n) is a C++ construct that enables a programmer to define a new data type.
iuytrewq
Data Abstraction & Problem Solving with C++: Walls and Mirrors 7th Edition
by Frank Carrano, Timothy Henry
ST
U
D
YL
AB
, Table of Content
1.Data Abstraction: The Walls
2.Recursion: The Mirrors
3.Array-Based Implementations
4.Link-Based Implementations
5.Recursion as a Problem-Solving Technique
6.Stacks
7.Stack Implementations
8.Lists
9.List Implementations
10.Algorithm Efficiency
ST
11.Sorting Algorithms and Their Efficiency
12.Sorted Lists and Their Implementations
13.Queues and Priority Queues
U
14.Queue Implementations
15.Trees
16.Tree Implementations
D
17.Heaps
18.Dictionaries and Their Implementations
YL
19.Balanced Search Trees
20.Graphs
21.Processing Data in External Storage
AB
, jhgfdsa
Multiple Choice Questions
1. The specifications of an ADT’s operations indicate .
a. what the operations do
b. how to implement the operations
c. how to store the data in the ADT
d. how to carry out the operations
Answer: a.
2. Data structures are part of an ADT’s .
a. definition
b. implementation
c. specifications
d. usage
Answer: b.
ST
3. A(n) allows two modules to communicate with each other.
a. data structure
b. axiom
c. interface
d. client
Answer: c.
U
4. An ADT’s govern(s) what its operations are and what they do.
a. specifications
b. implementation
D
c. documentation
d. data structure
Answer: a.
YL
5. When each module performs one well-defined task, we say that it is .
a. loosely coupled
b. highly coupled
c. cohesive
d. not easily reused
Answer: c.
AB
6. When should an operation contract be written?
a. during analysis
b. after coding
c. at the same time as user documentation
d. when taking initial notes from client
Answer: a.
7. What information is included in the operation contract?
a. the method’s interface
b. data flow among the modules
c. assumptions about input
d. all of these
Answer: d.
8. What kind of interface contains a method if and only that method is essential to that class’s
responsibilities?
a. complete
b. minimal
iuytrewq
, jhgfdsa
c. expanded
d. compact
Answer: b.
9. What must be known about the ADT Bag in order to use it in a program?
a. how entries in the bag are represented
b. how bag operations are implemented
c. how many entries can be stored in the bag
d. the interface of the bag
Answer: d.
10. According the CRC specifications for a Bag, which of the following behaviors would not be one of the
responsibilities of the class Bag?
a. See if the bag is empty
b. See if the bag is full
c. Look at all the objects in the bag
ST
d. Count the number of times a certain object occurs in the bag
Answer: b.
11. A client program depends solely on the of the ADT.
a. data members
b. structure
U
c. implementation
d. behavior
Answer: d.
D
12. What should a programmer do before implementing a recently designed class?
a. write code that uses the class
b. check comments that document specifications
c. adjust the design when problems are discovered
YL
d. all of these
Answer: d
13. Object-oriented programming views a program as .
a. a sequence of actions
b. a collection of classes
AB
c. a group of methods
d. an interaction among objects
Answer: d.
14. An ADT’s operations are known as its .
a. axioms
b. methods
c. variables
d. interfaces
Answer: b.
15. Encapsulation combines an ADT’s data with its operations to form a(n) .
a. exception
b. method
c. object
d. variable
Answer: c.
16. A(n) is a C++ construct that enables a programmer to define a new data type.
iuytrewq