Deck 13: Advanced Implementations of Tables
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
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
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/60
Play
Full screen (f)
Deck 13: Advanced Implementations of Tables
1
A 4-node contains ______ data item(s).
A)one
B)two
C)three
D)four
A)one
B)two
C)three
D)four
C
2
In a 2-3-4 tree,a leaf may contain ______ data items.
A)one or two
B)two or three
C)one,two,or three
D)one,two,three,or four
A)one or two
B)two or three
C)one,two,or three
D)one,two,three,or four
C
3
All the nodes in a binary tree are ______.
A)single nodes
B)1-nodes
C)2-nodes
D)double nodes
A)single nodes
B)1-nodes
C)2-nodes
D)double nodes
C
4
If a particular 2-3 tree does NOT contain 3-nodes,it is like a ______.
A)general tree
B)binary search tree
C)full binary tree
D)complete binary tree
A)general tree
B)binary search tree
C)full binary tree
D)complete binary tree
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
5
In a 4-node,the smallest search key is found in the ______ subtree.
A)left
B)middle-left
C)middle-right
D)right
A)left
B)middle-left
C)middle-right
D)right
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
6
A node that contains two data items and has three children is called a ______.
A)2-node
B)3-node
C)double node
D)triple node
A)2-node
B)3-node
C)double node
D)triple node
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
7
In a 2-3 tree,______.
A)all internal nodes have 2 children
B)all internal nodes have 3 children
C)all leaves are at the same level
D)all nodes have 2 data items
A)all internal nodes have 2 children
B)all internal nodes have 3 children
C)all leaves are at the same level
D)all nodes have 2 data items
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
8
In a 4-node,the largest search key is found in the ______ subtree.
A)left
B)middle-left
C)middle-right
D)right
A)left
B)middle-left
C)middle-right
D)right
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
9
The maximum height of a binary search tree of n nodes is ______.
A)n
B)n - 1
C)n / 2
D)log2(n + 1)
A)n
B)n - 1
C)n / 2
D)log2(n + 1)
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
10
A 4-node is found in a(n)______.
A)AVL tree
B)2-3 tree
C)2-3-4 tree
D)red-black
A)AVL tree
B)2-3 tree
C)2-3-4 tree
D)red-black
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
11
In a 3-node,______.
A)the left child has the largest search key
B)the middle child has smallest search key
C)the middle child has the largest search key
D)the right child has the largest search key
A)the left child has the largest search key
B)the middle child has smallest search key
C)the middle child has the largest search key
D)the right child has the largest search key
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
12
In the binary search tree implementation of the ADT table,the maximum number of comparisons required by the tableInsert operation is equal to ______.
A)the number of nodes in the binary search tree
B)the height of the binary search tree
C)the number of leaves in the binary search tree
D)the number of internal nodes in the binary search tree
A)the number of nodes in the binary search tree
B)the height of the binary search tree
C)the number of leaves in the binary search tree
D)the number of internal nodes in the binary search tree
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
13
Searching a 2-3 tree is ______.
A)O(n)
B)O(log2ⁿ)
C)O(log2ⁿ * n)
D)O(n²)
A)O(n)
B)O(log2ⁿ)
C)O(log2ⁿ * n)
D)O(n²)
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
14
A 2-3 implementation of a table is ______ for all table operations.
A)O(n)
B)O(log2ⁿ)
C)O(log2ⁿ * n)
D)O(n²)
A)O(n)
B)O(log2ⁿ)
C)O(log2ⁿ * n)
D)O(n²)
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
15
Locating a particular item in a binary search tree of n nodes requires at most ______ comparisons.
A)n
B)n * 3
C)n / 2
D)n - (n / 2)
A)n
B)n * 3
C)n / 2
D)n - (n / 2)
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
16
A node that contains one data item and has two children is called a ______.
A)1-node
B)2-node
C)single node
D)double node
A)1-node
B)2-node
C)single node
D)double node
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
17
In a 2-3 tree,a leaf may contain ______ data item(s).
A)one
B)one or two
C)two
D)two or three
E)three
A)one
B)one or two
C)two
D)two or three
E)three
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
18
A(n)______ is a tree in which each internal node has either two or three children,and all leaves are at the same level.
A)red-black tree
B)2-3 tree
C)2-3-4 tree
D)AVL tree
A)red-black tree
B)2-3 tree
C)2-3-4 tree
D)AVL tree
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
19
A 2-3 tree of height h always has at least ______ nodes.
A)h²
B)h² - 2
C)2h
D)2h - 1
A)h²
B)h² - 2
C)2h
D)2h - 1
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
20
Which of the following is NOT true about a red-black tree?
A)it is balanced
B)its insertion operation requires one pass from root to leaf
C)its deletion operation requires one pass from root to leaf
D)it requires more storage than a 2-3-4 tree
A)it is balanced
B)its insertion operation requires one pass from root to leaf
C)its deletion operation requires one pass from root to leaf
D)it requires more storage than a 2-3-4 tree
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
21
The height of a binary tree is sensitive to the order in which items are inserted into the tree.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
22
A 2-3-4 tree is always balanced.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
23
A 2-3 tree is never taller than a minimum-height binary tree.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
24
______ is a collision-resolution scheme that searches the hash table sequentially,starting from the original location specified by the hash function,for an unoccupied location.
A)Linear probing
B)Quadratic probing
C)Double hashing
D)Separate chaining
A)Linear probing
B)Quadratic probing
C)Double hashing
D)Separate chaining
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
25
A 2-3 tree is a binary tree.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
26
A hash table is a(n)______.
A)stack
B)queue
C)array
D)list
A)stack
B)queue
C)array
D)list
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
27
Insertions and deletions on a 2-3 tree requires fewer steps than insertions and deletions on a 2-3-4 tree.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
28
A balanced binary search tree would have the maximum height possible for the tree.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
29
Operations which are used to maintain the balance of AVL trees are known as ______.
A)revolutions
B)rotations
C)hash functions
D)refractions
A)revolutions
B)rotations
C)hash functions
D)refractions
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
30
______ is a collision-resolution scheme that searches the hash table for an unoccupied location beginning with the original location that the hash function specifies and continuing at increments of 12,22,32,and so on.
A)Linear probing
B)Double hashing
C)Quadratic probing
D)Separate chaining
A)Linear probing
B)Double hashing
C)Quadratic probing
D)Separate chaining
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
31
A(n)______ maps the search key of a table item into a location that will contain the item.
A)hash function
B)hash table
C)AVL tree
D)red-black tree
A)hash function
B)hash table
C)AVL tree
D)red-black tree
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
32
A 3-node contains three data items.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
33
A 2-3-4 tree requires more storage than a binary search tree.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
34
A red-black representation of a 2-3-4 tree is unique.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
35
The sequence of locations in a hash table that a collision resolution scheme examines is known as a(n)______ sequence.
A)iteration
B)hash
C)collision
D)probe
A)iteration
B)hash
C)collision
D)probe
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
36
The condition that occurs when a hash function maps two or more distinct search keys into the same location is called a(n)______.
A)disturbance
B)collision
C)rotation
D)congestion
A)disturbance
B)collision
C)rotation
D)congestion
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
37
______ is a collision-resolution scheme that uses an array of linked lists as a hash table.
A)Linear probing
B)Double hashing
C)Quadratic probing
D)Separate chaining
A)Linear probing
B)Double hashing
C)Quadratic probing
D)Separate chaining
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
38
The load factor of a hash table is calculated as ______.
A)table size + current number of table items
B)table size - current number of table items
C)current number of table items * table size
D)current number of table items / table size
A)table size + current number of table items
B)table size - current number of table items
C)current number of table items * table size
D)current number of table items / table size
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
39
A node in a red-black tree requires less storage than a node in a 2-3-4 tree.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
40
A(n)______ is a balanced binary search tree.
A)2-3 tree
B)2-3-4 tree
C)red-black
D)AVL
A)2-3 tree
B)2-3-4 tree
C)red-black
D)AVL
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
41
What is a bucket?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
42
What is a 3-node?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
43
What is a disadvantage of a 2-3-4 tree when compared with a binary search tree?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
44
In a 2-3 tree,how is the search key of a 3-node related to the search keys in the left subtree,the middle subtree,and the right subtree of the 3-node?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
45
What is the advantage of using a variation of a binary search tree,such as a 2-3 tree or a 2-3-4 tree,instead of a binary search tree?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
46
What is a perfect hash function?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
47
Suppose we have already inserted the values 5,10 and 15 into an empty 2-3-4 tree.Explain what happens when we insert the value 20 into this tree.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
48
What makes 2-3-4 trees more attractive than 2-3 trees?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
49
Suppose we wanted to use a hash table to store people's names.Each name is a String object.What is wrong with using the length of the string as the hash value of each name?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
50
In designing a hash table,why do we want the size of the table to be significantly larger than the maximum number of entries that we will insert into it?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
51
What are the two types of rotations possible in an AVL tree?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
52
What is the maximum and the minimum number of children that an internal node can have in a 2-3 tree?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
53
In a 2-3 tree,how is the search key of a 2-node related to the search keys in the left subtree and the right subtree of the 2-node?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
54
What is meant by clustering? How does clustering affect the overall efficiency of hashing?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
55
What are the two types of approaches for resolving collisions in a hash table design?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
56
Suppose we want to delete a node from an AVL tree.If this node does not have any children,is it possible that removing this node would require us to perform a rotation operation? Explain.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
57
What is a 4-node?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
58
In a 2-3-4 tree,when is a 4-node split during an insertion operation?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
59
What is a 2-node?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
60
What is a collision?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck