Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Data Structures and Abstractions with Java, 5th edition — by Frank Carrano — Complete Test Bank (Ch. 1-30)

Rating
-
Sold
-
Pages
229
Grade
A+
Uploaded on
04-04-2026
Written in
2025/2026

Data Structures and Abstractions with Java, 5th edition — by Frank Carrano — Complete Test Bank (Ch. 1-30)

Institution
Data Structures And Abstractions With Java
Course
Data Structures and Abstractions with Java

Content preview

TEST BANK
Data Structures and Abstractions with Java, 5th edition
by Frank Carrano, Timothy Henry
LU
XE
LI
BR
AR
Y

, TABLE OF CONTENT

Bags
Java Interlude 1 Generics
Bag Implementations That Use Arrays
Java Interlude 2 Exceptions
A Bag Implementation That Links Data
The Efficiency of Algorithms
Stacks
Stack Implementations
Java Interlude 3 More About Exceptions
Queues, Deques, and Priority Queues
Queue, Deque, and Priority Queue Implementations
LU
Recursion
Lists
A List Implementation That Uses an Array
A List Implementation That Links Data
Java Interlude 4 Iterators
Iterators for the ADT List
XE
Problem Solving With Recursion
Java Interlude 5 More About Generics
An Introduction to Sorting
Faster Sorting Methods
Java Interlude 6 Mutable and Immutable Objects
LI
Sorted Lists
Java Interlude 7 Inheritance and Polymorphism
Inheritance and Lists
Searching
BR
Java Interlude 8 Generics Once Again
Dictionaries
Dictionary Implementations
Introducing Hashing
Hashing as a Dictionary Implementation
Trees
AR
Tree Implementations
Java Interlude 9 Cloning
A Binary Search Tree Implementation
A Heap Implementation
Balanced Search Trees
Graphs
Y
Graph Implementations
Appendices
A. Documentation and Programming Style
B. Java Classes
C. Creating Classes from Other Classes

, KJHGFDSA


Chapter 1 - Bags



True/False (10) All Chapters Included

1. An abstract data type is not necessarily a collection.
All Answers Included
Answer: true

2. A collection is not necessarily an abstract data type.
LU
Answer: false

3. Entries of a bag can belong to classes related by inheritance.

Answer: true
XE
4. Entries of a bag may belong to different classes because items are unordered.

Answer: false

5. All entries of a bag must have the same data type or a subtype of that data type.
LI
Answer: true

6. By declaring a data type to be a BagInterface, we can replace the bag class with another class
that implements the BagInterface.
BR
Answer: true

7. A method can change the state of an object passed to it as an argument.

Answer: true
AR
8. A set is a special kind of bag.

Answer: true

9. You cannot determine the exact number of times a particular item appears in a bag because it is
unordered.
Y
Answer: false

10. Code written with respect to an interface makes it difficult to replace one implementation of a
bag with another.

Answer: false




jkhgfdsa

, KJHGFDSA


Short Answer (5)

1. Explain the rationale for returning a Boolean value from the add bag operation.

Answer: A client should know what happened. A Boolean value indicates true for success or false
for a failed operation.

2. Explain why writing a test program before implementing a class is a good idea.

Answer: It helps you understand the specifications before committing to your design and
LU
implementation.

3. Explain why the set ADT does not need a getFrequencyOf operation.

Answer: Because sets do not contain duplicate items, only a 0 for absence or 1 for presence of an
item would be returned. Using a contains method is a better design.
XE
4. What is the design rationale for providing a toArray method instead of a displayBag method?

Answer: The user/client is free to display any or all of the items in any way desired.

5. Explain why null is a potential return value for the remove operation.
LI
Answer: It is a value that cannot be in the bag and therefore signals a problem if, for example, a
client tries to remove an entry from an empty bag.
BR
Multiple Choice (30) WARNING: CORRECT ANSWERS ARE IN THE SAME POSITION AND TAGGED
WITH **. YOU SHOULD RANDOMIZE THE LOCATION OF THE CORRECT ANSWERS IN YOUR EXAM.

1. A language-independent specification for a group of values and operations on those values is
called a/an:
AR
a. abstract data type **
b. data structure
c. collection
d. primitive

2. An implementation of an ADT with a programming language is called a/an:
Y
a. data structure **
b. abstract data type
c. collection
d. primitive

3. An object that groups other objects and provides services to its clients is called a/an:
a. collection **




jkhgfdsa

Written for

Institution
Data Structures and Abstractions with Java
Course
Data Structures and Abstractions with Java

Document information

Uploaded on
April 4, 2026
Number of pages
229
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$21.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
LuxeLibrary Rasmussen College
View profile
Follow You need to be logged in order to follow users or courses
Sold
426
Member since
2 year
Number of followers
153
Documents
1512
Last sold
2 days ago
PassVault

PassVault is your Ultimate digital Vault for academic success - a curated hub of notes, test banks, study guides, and solution manuals designed to help you learn smarter, not harder. Unlock top-tier resources trusted by students who aim higher. Unlock knowledge. Master your Exams. No more stress. Just Results.

3.8

35 reviews

5
17
4
7
3
3
2
2
1
6

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions