MCQ
MCQ
a)AVLtree
b)B-tree
c)Red-blacktree
d) Both AVL tree and Red-black tree
2. B-tree of order n is a order-n multiway tree in which each non-root node contains
__________
a)atmost(n–1)/2keys
b)exact(n–1)/2keys
c)atleast2nkeys
d)atleast(n–1)/2keys
View Answer
3. A B-tree of order 4 and of height 3 will have a maximum of _______ keys.
a) 255
b) 63
c) 127
d) 188
View Answer
4. Five node splitting operations occurred when an entry is inserted into a B-tree. Then
how many nodes are written?
a) 14
b) 7
c) 11
d) 5
View Answer
5. B-tree and AVL tree have the same worst case time complexity for insertion and
deletion.
a) True
b) False
. 2-3-4 trees are B-trees of order 4. They are an isometric of _____ trees.
a) AVL
b) AA
c) 2-3
d) Red-Black
View Answer
7. Figure shown below is B-tree of order 5. What is the result of deleting 130 from the
tree?
a)
b)
c)
d)
View Answer
8. What is the best case height of a B-tree of order n and which has k keys?
a) logn (k+1) – 1
b) nk
c) logk (n+1) – 1
d) klogn
View Answer
9. Compression techniques can be used on the keys to reduce both space and time
requirements in a B-tree.
a) True
b) False
View Answer
10. Which of the following is true?
a) larger the order of B-tree, less frequently the split occurs
b) larger the order of B-tree, more frequently the split occurs
c) smaller the order of B-tree, more frequently the split occurs
d) smaller the order of B-tree, less frequently the split occurs
1. In a B+ tree, both the internal nodes and the leaves have keys.
a) True
b) False
View Answer
a)
b)
c)
d)
View Answer
advertisement
6. Statement 1: When a node is split during insertion, the middle key is promoted to the
parent as well as retained in right half-node.
Statement 2: When a key is deleted from the leaf, it is also deleted from the non-leaf
nodes of the tree.
a) Statement 1 is true but statement 2 is false
b) Statement 2 is true but statement 1 is false
c) Both the statements are true
d) Both the statements are false
View Answer
7. Efficiency of finding the next record in B+ tree is ____
a) O(n)
b) O(log n)
c) O(nlog n)
d) O(1)
View Answer
8. What is the maximum number of keys that a B+ -tree of order 3 and of height 3 have?
a) 3
b) 80
c) 27
d) 26
View Answer
9. Which of the following is false?
a) Compared to B-tree, B+ -tree has larger fanout
b) Deletion in B-tree is more complicated than in B+ -tree
c) B+ -tree has greater depth than corresponding B-tree
d) Both B-tree and B+ -tree have same search and insertion efficiencies
View Answer
10. Which one of the following data structures are preferred in database-system
implementation?
a) AVL tree
b) B-tree
c) B+ -tree
d) Splay tree
View Answer
Question 3 : Which of the following is the most widely used external memory data structure?
1. AVL tree
2. B-tree
3. Red-black tree
4. Both AVL tree and Red-black tree
View Answer Discuss with Members
Question 5 : 2-3-4 trees are B-trees of order 4. They are an isometric of _____ trees.
1. AVL
2. AA
3. 2-3
4. Red-Black
View Answer Discuss with Members
Question 6 : A B+ tree can contain a maximum of 7 pointers in a node. What is the minimum number of
keys in leaves?
1. 6
2. 3
3. 4
4. 7
View Answer Discuss with Members
Question 7 : Statement 1: When a node is split during insertion, the middle key is promoted to the
parent as well as retained in right half-node.
Statement 2: When a key is deleted from the leaf, it is also deleted from the non-leaf nodes of the tree.
1. Statement 1 is true but statement 2 is false
2. Statement 2 is true but statement 1 is false
3. Both the statements are true
4. Both the statements are false
View Answer Discuss with Members
Question 8 : B-tree and AVL tree have the same worst case time complexity for insertion and deletion.
1. True
2. False
3.
4.
View Answer Discuss with Members
Question 9 : Compression techniques can be used on the keys to reduce both space and time
requirements in a B-tree.
1. True
2. False
3.
4.
View Answer Discuss with Members
Question 10 : Which of the following the BST is isometric with the 2-3 tree?
1. Splay tree
2. AA tree
3. Heap
4. Red – Black tree
Question 12 : What is the maximum number of keys that a B+ -tree of order 3 and of height 3 have?
1. 3
2. 80
3. 27
4. 26
View Answer Discuss with Members
Question 13 : Five node splitting operations occurred when an entry is inserted into a B-tree. Then how
many nodes are written?
1. 14
2. 7
3. 11
4. 5
View Answer Discuss with Members
Question 14 : B-tree of order n is a order-n multiway tree in which each non-root node contains
__________
1. at most (n – 1)/2 keys
2. exact (n – 1)/2 keys
3. at least 2n keys
4. at least (n – 1)/2 keys
View Answer Discuss with Members
Question 15 : Which one of the following data structures are preferred in database-system
implementation?
1. AVL tree
2. B-tree
3. B+ -tree
4. Splay tree
View Answer Discuss with Members
Question 16 : Which of the following data structure can provide efficient searching of the elements?
1. unordered lists
2. binary search tree
3. treap
4. 2-3 tree
View Answer Discuss with Members
Question 17 : What is the best case height of a B-tree of order n and which has k keys?
1. logn (k+1) – 1
2. nk
3. logk (n+1) – 1
4. klogn
View Answer Discuss with Members
Question 19 : Which of the following is not true about the 2-3 tree?
1. all leaves are at the same level
2. it is perfectly balanced
3. postorder traversal yields elements in sorted order
4. it is B-tree of order 3
View Answer Discuss with Members
Question 20 : A B-tree of order 4 and of height 3 will have a maximum of _______ keys.
1. 255
2. 63
3. 127
4. 188
B-Trees on Data Structure and Algorithms related Questions and Answers - Page 3
Question 21 : AVL trees provide better insertion the 2-3 trees.
1. True
2. False
3.
4.
View Answer Discuss with Members
Question 22 : In a B+ tree, both the internal nodes and the leaves have keys.
1. True
2. False
. What is the special property of red-black trees and what root should always be?
a) a color which is either red or black and root should always be black color only
b) height of the tree
c) pointer to next node
d) a color which is either green or black
. Why do we impose restrictions like
. root property is black
. every leaf is black
. children of red node are black
. all leaves have same black
a) to get logarithm time complexity
b) to get linear time complexity
c) to get exponential time complexity
d) to get constant time complexity
View Answer
3. Cosider the below formations of red-black tree.
All the above formations are incorrect for it to be a redblack tree. then what may be the
correct order?
a) 50-black root, 18-red left subtree, 100-red right subtree
b) 50-red root, 18-red left subtree, 100-red right subtree
c) 50-black root, 18-black left subtree, 100-red right subtree
d) 50-black root, 18-red left subtree, 100-black right subtree
View Answer
4. What are the operations that could be performed in O(logn) time complexity by red-
black tree?
a) insertion, deletion, finding predecessor, successor
b) only insertion
c) only finding predecessor, successor
d) for sorting
View Answer
5. Which of the following is an application of Red-black trees and why?
a) used to store strings efficiently
b) used to store integers efficiently
c) can be used in process schedulers, maps, sets
d) for efficient sorting
a) true
b) false
View Answer
9. What output does the below pseudo code produces?
Tree_node function(Tree_node x)
{
Tree_node y = x.left;
x.left = y.right;
y.right = x;
return y;
}
a) right rotation of subtree
b) left rotation of subtree
c) zig-zag operation
d) zig-zig operation
View Answer
advertisement