Deck 22: Custom Generic Data Structures
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/16
Play
Full screen (f)
Deck 22: Custom Generic Data Structures
1
Java performs automatic __________ of objects that are no longer referenced in a program.
A)memory distribution.
B)garbage collection.
C)storage compression.
D)trash aggregation.
A)memory distribution.
B)garbage collection.
C)storage compression.
D)trash aggregation.
B
2
A queue is a __________ data structure.
A)FOFI.
B)FIFO.
C)OFIF.
D)IFOF.
A)FOFI.
B)FIFO.
C)OFIF.
D)IFOF.
B
3
A stack is a __________ data structure.
A)FILO.
B)FOLI.
C)LOFI.
D)LIFO.
A)FILO.
B)FOLI.
C)LOFI.
D)LIFO.
D
4
Which statement is false?
A)In a tightly packed binary tree,each level contains about twice as many elements as the previous level.
B)When searching a tightly packed 1,000,000-element binary search tree,approximately 20 comparisons need to be made.
C)The level-order traversal of a binary tree visits the nodes of the tree row-by-row starting at the root node level.
D)Searching a binary tree for a value that matches a key value is slow for loosely packed trees.
A)In a tightly packed binary tree,each level contains about twice as many elements as the previous level.
B)When searching a tightly packed 1,000,000-element binary search tree,approximately 20 comparisons need to be made.
C)The level-order traversal of a binary tree visits the nodes of the tree row-by-row starting at the root node level.
D)Searching a binary tree for a value that matches a key value is slow for loosely packed trees.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
5
The technique of implementing each stack method as a call to a List method is called __________.
A)delegation.
B)delimiting.
C)assigning.
D)shifting responsibility.
A)delegation.
B)delimiting.
C)assigning.
D)shifting responsibility.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
6
Which statement is false?
A)When a method call is made,the called method must know how to return to its caller,so the return address is pushed onto the program execution stack.
B)Stacks support recursive method calls in the same manner as conventional,nonrecursive method calls.
C)The program execution stack contains the space created for a method's global variables on each invocation of that method during a program's execution.
D)When a method returns to its caller,the memory for that method's local variables is popped off the stack and those variables are no longer known to the program.
A)When a method call is made,the called method must know how to return to its caller,so the return address is pushed onto the program execution stack.
B)Stacks support recursive method calls in the same manner as conventional,nonrecursive method calls.
C)The program execution stack contains the space created for a method's global variables on each invocation of that method during a program's execution.
D)When a method returns to its caller,the memory for that method's local variables is popped off the stack and those variables are no longer known to the program.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
7
If no memory is available,keyword new throws an __________.
A)OutOfMemoryException.
B)OutOfMemoryEvent.
C)OutOfMemoryExhaustion.
D)OutOfMemoryError.
A)OutOfMemoryException.
B)OutOfMemoryEvent.
C)OutOfMemoryExhaustion.
D)OutOfMemoryError.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
8
Which statement is false?
A)Linked lists are collections of data items "lined up in a row"insertions and deletions can be made anywhere in a linked list.
B)Insertions and deletions are made only at one end of a stack,its top.
C)Insertions and deletions are made only at one end of a queue,its tail.
D)Binary trees facilitate high-speed searching and sorting of data.
A)Linked lists are collections of data items "lined up in a row"insertions and deletions can be made anywhere in a linked list.
B)Insertions and deletions are made only at one end of a stack,its top.
C)Insertions and deletions are made only at one end of a queue,its tail.
D)Binary trees facilitate high-speed searching and sorting of data.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
9
A __________ class contains a reference member that refers to an object of the same class type.
A)self-determining.
B)self-pointing.
C)self-linking.
D)self-referential.
A)self-determining.
B)self-pointing.
C)self-linking.
D)self-referential.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
10
An isEmpty method you write to test whether a linked list is empty is called a __________ method.
A)predefined.
B)predicate.
C)preemption.
D)preorder.
A)predefined.
B)predicate.
C)preemption.
D)preorder.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
11
Queue nodes are removed only from the __________ of the queue,and are inserted only at the __________ of the queue.
A)tail,tail.
B)tail,head.
C)head,tail.
D)head,head.
A)tail,tail.
B)tail,head.
C)head,tail.
D)head,head.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
12
Which statement is false?
A)A linked list is a linear collection of self-referential class objects called nodes connected by reference links.
B)A linked list is appropriate when the number of data elements to be represented in the data structure is unpredictable.
C)The java.util package contains class LinkedList.
D)By convention,the link reference in the last node of a list is set to null to mark the end of the list.
A)A linked list is a linear collection of self-referential class objects called nodes connected by reference links.
B)A linked list is appropriate when the number of data elements to be represented in the data structure is unpredictable.
C)The java.util package contains class LinkedList.
D)By convention,the link reference in the last node of a list is set to null to mark the end of the list.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
13
Which statement about trees is false?
A)A tree is a nonlinear,two-dimensional data structure.
B)Each node in a tree contains two links.
C)The children of a node are called siblings.
D)A node with no children is called a leaf node.
A)A tree is a nonlinear,two-dimensional data structure.
B)Each node in a tree contains two links.
C)The children of a node are called siblings.
D)A node with no children is called a leaf node.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
14
Which is not a typical application of queues?
A)Routing packets in a computer network.
B)File server handling file access requests from many clients.
C)High-speed sorting.
D)Print spooling.
A)Routing packets in a computer network.
B)File server handling file access requests from many clients.
C)High-speed sorting.
D)Print spooling.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
15
Which statement is false?
A)The shape of a binary search tree that corresponds to a set of data can vary,depending on the order in which the values are inserted into the tree.
B)A node can be inserted at any point in a binary search tree.
C)The process of creating a binary search tree actually sorts the data,and thus this process is called the binary tree sort.
D)The binary search tree facilitates duplicate elimination.
A)The shape of a binary search tree that corresponds to a set of data can vary,depending on the order in which the values are inserted into the tree.
B)A node can be inserted at any point in a binary search tree.
C)The process of creating a binary search tree actually sorts the data,and thus this process is called the binary tree sort.
D)The binary search tree facilitates duplicate elimination.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck
16
Usually a _________ indicates the end of a data structure.
A)backslash character.
B)forward slash character
C)null reference.
D)null pointer.
A)backslash character.
B)forward slash character
C)null reference.
D)null pointer.
Unlock Deck
Unlock for access to all 16 flashcards in this deck.
Unlock Deck
k this deck