Deck 19: Data Structures
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
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/28
Play
Full screen (f)
Deck 19: Data Structures
1
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.
C
2
A doubly linked list can be traversed both forwards and backwards.
True
3
Boxing can be either implicit or explicit.
True
4
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 System.LL namespace 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 System.LL namespace 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 28 flashcards in this deck.
Unlock Deck
k this deck
5
Typecasting anything that's not an object into an object is known as _________.
A) unboxing
B) converting
C) wrapping
D) boxing
A) unboxing
B) converting
C) wrapping
D) boxing
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
6
Usually a _________ indicates to a program 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 28 flashcards in this deck.
Unlock Deck
k this deck
7
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 28 flashcards in this deck.
Unlock Deck
k this deck
8
Every simple type struct inherits from class ________.
A)SimpleType
B) Number
C) ValueType
D) Struct
A)SimpleType
B) Number
C) ValueType
D) Struct
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
9
Dynamic data structures grow and shrink at ______ time.
A)compilation
B) execution
C) a and b
D) None of the above
A)compilation
B) execution
C) a and b
D) None of the above
Unlock Deck
Unlock for access to all 28 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 28 flashcards in this deck.
Unlock Deck
k this deck
11
A queue is a __________ data structure.
A) FOFI
B) FIFO
C) OFIF
D) IFOF
A) FOFI
B) FIFO
C) OFIF
D) IFOF
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
12
A stack is a __________ data structure.
A) FILO
B) FOLI
C) LOFI
D) LIFO
A) FILO
B) FOLI
C) LOFI
D) LIFO
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
13
C# programs must explicitly release dynamically allocated memory.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
14
Unboxing can be either implicit or explicit.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
15
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 28 flashcards in this deck.
Unlock Deck
k this deck
16
An array is a dynamic data structure.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
17
If no memory is available,new throws an OutOfMemoryException.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
18
In a circular linked list,each node is connected to every other node.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
19
The two primary operations when manipulating a stack are push and pop.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
20
___________ conversion is when an object is cast into another type.
A) unboxing
B) converting
C) wrapping
D) boxing
A) unboxing
B) converting
C) wrapping
D) boxing
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
21
Like linked lists,stacks,and queues,trees are also linear data structures.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
22
A queue can naturally represent a real-life waiting line.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
23
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 28 flashcards in this deck.
Unlock Deck
k this deck
24
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 28 flashcards in this deck.
Unlock Deck
k this deck
25
Which statement about trees is false
A) A tree is a nonlinear, two-dimensional data structure.
B) Each node in a tree must contain two links.
C) Children of the same 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 must contain two links.
C) Children of the same node are called siblings.
D) A node with no children is called a leaf node.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
26
The insert and remove operations for a queue are known as dequeue and enqueue,respectively.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck
27
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 28 flashcards in this deck.
Unlock Deck
k this deck
28
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, a maximum of 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 tightly 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, a maximum of 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 tightly packed trees.
Unlock Deck
Unlock for access to all 28 flashcards in this deck.
Unlock Deck
k this deck