Deck 14: Introduction to Collections

Full screen (f)
exit full mode
Question
Collections are typically static. ____________________
Use Space or
up arrow
down arrow
to flip the card.
Question
A programmer chooses a collection class based on ____.

A) the logic of an application
B)
B) the collection's run-time performance
C) the number of classes it implements
D) both a and
Question
A(n) ____ is a linear sequence of elements of any type by numeric index position.

A) string
B) list
C) stack
D) queue
Question
A map is a collection of unique items called entries. Each entry contains a key and a value.
Question
Infix evaluation applies operators as soon as they are encountered and never requires parentheses. ____________________
Question
The traversal operation visits each item in a collection in order to access or modify it. ____________________
Question
The index positions available for access in a list range from 0 to its physical size minus 1. ____________________
Question
A list tracks its own logical size and grows or shrinks automatically as needed.
Question
Collections must be homogeneous, meaning the items are all of the same type.
Question
Identify the letter of the choice that best matches the phrase or definition.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
Collections are used to help programmers effectively organize data in programs.
Question
In modern languages like Java, arrays are considered a lower-level data structure and are often used to implement other collections.
Question
A(n) ____ is a linear sequence of characters with access to the end, called the top.

A) string
B) list
C) stack
D) queue
Question
A(n) ____ provides a logical view of the behavior of a class of objects.

A) interface
B) collection
C) method
D) package
Question
In a map, an attribute can also be an object's key.
Question
The contents and size of a collection typically do not change during the course of a program.
Question
A list can contain values such as int and double.
Question
Strings and arrays are examples of collections.
Question
The most prevalent application of queues is in database management.
Question
The replacement operation combines removal and insertion into a single operation. ____________________
Question
A(n) ____ is a linear sequence of characters accessed by numeric index position.

A) string
B) list
C) stack
D) queue
Question
Translating infix expressions to postfix form is an example of an application of a ____.

A) list
B) tree
C) queue
D) stack
Question
A(n) ____________________ contains a group of items that are treated as a conceptual unit.
Question
Each type of collection supports some form of all of the following EXCEPT ____.

A) addition
B) removal
C) membership
D) hierarchy
Question
An association list is another word for a(n) ____.

A) stack
B) map
C) queue
D) set
Question
When a name such as E is used to specify a type in an interface, it is called a type ____.

A) parameter
B) variable
C) character
D) element
Question
FIGURE 14-1 <strong>FIGURE 14-1   Java's built-in collections are defined in the package ____, as shown in Figure 14-1 above.</strong> A) java.groups B) java.sets C) java.collections D) java.util <div style=padding-top: 35px>
Java's built-in collections are defined in the package ____, as shown in Figure 14-1 above.

A) java.groups
B) java.sets
C) java.collections
D) java.util
Question
The ____ of two sets (A and B) is the set of items in A that are also items in B.

A) union
B) intersection
C) subset
D) collection
Question
The index-based operations on linked lists run in ____ time.

A) constant
B) consecutive
C) linear
D) analog
Question
Identify the letter of the choice that best matches the phrase or definition.
a.Queue
b.Set
c.Map
d.Tree
e.Graph
A network of elements.
Question
When a name such as String takes the place of the type variable during instantiation, it is called a type ____.

A) parameter
B) array
C) character
D) element
Question
A(n) ____________________ is an object that allows the programmer to visit all of the elements in a collection.
Question
Identify the letter of the choice that best matches the phrase or definition.
a.Queue
b.Set
c.Map
d.Tree
e.Graph
An unordered collection of elements accessed by unique keys.
Question
Like an array, a(n) ____ is a sequence of elements that are ordered by an integer index position.

A) queue
B) list
C) stack
D) all of the above
Question
FIGURE 14-1 <strong>FIGURE 14-1   Which of the following is NOT true about how Chase will organize his data?</strong> A) The values are unique. B) The keys are unique. C) The keys are in no particular order. D) The value associated with a key contains the attributes of the identifier. <div style=padding-top: 35px>
Which of the following is NOT true about how Chase will organize his data?

A) The values are unique.
B) The keys are unique.
C) The keys are in no particular order.
D) The value associated with a key contains the attributes of the identifier.
Question
A ____ adheres to a First In First Out protocol.

A) list
B) tree
C) queue
D) stack
Question
When a method signature starts with the modifier ____, it means that the user of the method sends a message to the main class, not to an instance of any class.

A) static
B) public
C) private
D) superclass
Question
A programmer must use ____ to manipulate elements in a list.

A) the subscript operator [ ]
B) casting
C) methods
D) variables
Question
A ____ adheres to a Last In First Out protocol.

A) list
B) tree
C) queue
D) stack
Question
The ____ of two sets (A and B) is a set that contains all of the items in A and all of the items in B.

A) union
B) intersection
C) subset
D) collection
Question
A feature called ____________________ classes allows storage of primitive data types in lists.
Question
Identify the letter of the choice that best matches the phrase or definition.
a.Queue
b.Set
c.Map
d.Tree
e.Graph
An unordered collection of unique elements
Question
Identify the letter of the choice that best matches the phrase or definition.
a.Queue
b.Set
c.Map
d.Tree
e.Graph
A linear sequence of elements with insertions at the rear and removals at the front.
Question
Identify the letter of the choice that best matches the phrase or definition.
a.Queue
b.Set
c.Map
d.Tree
e.Graph
A hierarchical collection of elements.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/43
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 14: Introduction to Collections
1
Collections are typically static. ____________________
False
2
A programmer chooses a collection class based on ____.

A) the logic of an application
B)
B) the collection's run-time performance
C) the number of classes it implements
D) both a and
D
3
A(n) ____ is a linear sequence of elements of any type by numeric index position.

A) string
B) list
C) stack
D) queue
B
4
A map is a collection of unique items called entries. Each entry contains a key and a value.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
5
Infix evaluation applies operators as soon as they are encountered and never requires parentheses. ____________________
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
6
The traversal operation visits each item in a collection in order to access or modify it. ____________________
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
7
The index positions available for access in a list range from 0 to its physical size minus 1. ____________________
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
8
A list tracks its own logical size and grows or shrinks automatically as needed.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
9
Collections must be homogeneous, meaning the items are all of the same type.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
10
Identify the letter of the choice that best matches the phrase or definition.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
Collections are used to help programmers effectively organize data in programs.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
11
In modern languages like Java, arrays are considered a lower-level data structure and are often used to implement other collections.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
12
A(n) ____ is a linear sequence of characters with access to the end, called the top.

A) string
B) list
C) stack
D) queue
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
13
A(n) ____ provides a logical view of the behavior of a class of objects.

A) interface
B) collection
C) method
D) package
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
14
In a map, an attribute can also be an object's key.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
15
The contents and size of a collection typically do not change during the course of a program.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
16
A list can contain values such as int and double.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
17
Strings and arrays are examples of collections.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
18
The most prevalent application of queues is in database management.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
19
The replacement operation combines removal and insertion into a single operation. ____________________
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
20
A(n) ____ is a linear sequence of characters accessed by numeric index position.

A) string
B) list
C) stack
D) queue
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
21
Translating infix expressions to postfix form is an example of an application of a ____.

A) list
B) tree
C) queue
D) stack
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
22
A(n) ____________________ contains a group of items that are treated as a conceptual unit.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
23
Each type of collection supports some form of all of the following EXCEPT ____.

A) addition
B) removal
C) membership
D) hierarchy
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
24
An association list is another word for a(n) ____.

A) stack
B) map
C) queue
D) set
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
25
When a name such as E is used to specify a type in an interface, it is called a type ____.

A) parameter
B) variable
C) character
D) element
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
26
FIGURE 14-1 <strong>FIGURE 14-1   Java's built-in collections are defined in the package ____, as shown in Figure 14-1 above.</strong> A) java.groups B) java.sets C) java.collections D) java.util
Java's built-in collections are defined in the package ____, as shown in Figure 14-1 above.

A) java.groups
B) java.sets
C) java.collections
D) java.util
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
27
The ____ of two sets (A and B) is the set of items in A that are also items in B.

A) union
B) intersection
C) subset
D) collection
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
28
The index-based operations on linked lists run in ____ time.

A) constant
B) consecutive
C) linear
D) analog
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
29
Identify the letter of the choice that best matches the phrase or definition.
a.Queue
b.Set
c.Map
d.Tree
e.Graph
A network of elements.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
30
When a name such as String takes the place of the type variable during instantiation, it is called a type ____.

A) parameter
B) array
C) character
D) element
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
31
A(n) ____________________ is an object that allows the programmer to visit all of the elements in a collection.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
32
Identify the letter of the choice that best matches the phrase or definition.
a.Queue
b.Set
c.Map
d.Tree
e.Graph
An unordered collection of elements accessed by unique keys.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
33
Like an array, a(n) ____ is a sequence of elements that are ordered by an integer index position.

A) queue
B) list
C) stack
D) all of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
34
FIGURE 14-1 <strong>FIGURE 14-1   Which of the following is NOT true about how Chase will organize his data?</strong> A) The values are unique. B) The keys are unique. C) The keys are in no particular order. D) The value associated with a key contains the attributes of the identifier.
Which of the following is NOT true about how Chase will organize his data?

A) The values are unique.
B) The keys are unique.
C) The keys are in no particular order.
D) The value associated with a key contains the attributes of the identifier.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
35
A ____ adheres to a First In First Out protocol.

A) list
B) tree
C) queue
D) stack
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
36
When a method signature starts with the modifier ____, it means that the user of the method sends a message to the main class, not to an instance of any class.

A) static
B) public
C) private
D) superclass
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
37
A programmer must use ____ to manipulate elements in a list.

A) the subscript operator [ ]
B) casting
C) methods
D) variables
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
38
A ____ adheres to a Last In First Out protocol.

A) list
B) tree
C) queue
D) stack
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
39
The ____ of two sets (A and B) is a set that contains all of the items in A and all of the items in B.

A) union
B) intersection
C) subset
D) collection
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
40
A feature called ____________________ classes allows storage of primitive data types in lists.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
41
Identify the letter of the choice that best matches the phrase or definition.
a.Queue
b.Set
c.Map
d.Tree
e.Graph
An unordered collection of unique elements
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
42
Identify the letter of the choice that best matches the phrase or definition.
a.Queue
b.Set
c.Map
d.Tree
e.Graph
A linear sequence of elements with insertions at the rear and removals at the front.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
43
Identify the letter of the choice that best matches the phrase or definition.
a.Queue
b.Set
c.Map
d.Tree
e.Graph
A hierarchical collection of elements.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 43 flashcards in this deck.