0% found this document useful (0 votes)
318 views12 pages

MCQ

B-trees are the most widely used external memory data structure. They allow for rapid random access of data on disk and are commonly used to implement database indexes. B-trees maintain balanced trees with varying but limited node sizes, supporting efficient insertion and deletion of data over time.

Uploaded by

vrushali patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
318 views12 pages

MCQ

B-trees are the most widely used external memory data structure. They allow for rapid random access of data on disk and are commonly used to implement database indexes. B-trees maintain balanced trees with varying but limited node sizes, supporting efficient insertion and deletion of data over time.

Uploaded by

vrushali patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

1. Which of the following is the most widely used external memory data structure?

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

2. Which of the following is true?


a) B + tree allows only the rapid random access
b) B + tree allows only the rapid sequential access
c) B + tree allows rapid random access as well as rapid sequential access
d) B + tree allows rapid random access and slower sequential access
View Answer
3. A B+ tree can contain a maximum of 7 pointers in a node. What is the minimum
number of keys in leaves?
a) 6
b) 3
c) 4
d) 7
View Answer
4. Which of the following is false?
a) A B+ -tree grows downwards
b) A B+ -tree is balanced
c) In a B+ -tree, the sibling pointers allow sequential searching
d) B+ -tree is shallower than B-tree
View Answer
5. A B+ -tree of order 3 is generated by inserting 89, 9 and 8. The generated B+ -tree is
__________

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 2 : 2-3 tree is a specific form of _________


1. B – tree
2. B+ – tree
3. AVL tree
4. Heap
 View Answer    Discuss with Members

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 4 : Efficiency of finding the next record in B+ tree is ____


1. O(n)
2. O(log n)
3. O(nlog n)
4. O(1)
 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 11 : Which of the following is true?


1. B + tree allows only the rapid random access
2. B + tree allows only the rapid sequential access
3. B + tree allows rapid random access as well as rapid sequential access
4. B + tree allows rapid random access and slower sequential access
 View Answer    Discuss with Members

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 18 : Which of the following is false?


1. 2-3 tree requires less storage than the BST
2. lookup in 2-3 tree is more efficient than in BST
3. 2-3 tree is shallower than BST
4. 2-3 tree is a balanced tree
 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

6. When it would be optimal to prefer Red-black trees over AVL trees?


a) when there are more insertions or deletions
b) when more search is needed
c) when tree must be balanced
d) when log(nodes) time complexity is needed
View Answer
7. Why Red-black trees are preferred over hash tables though hash tables have
constant time complexity?
a) no they are not preferred
b) because of resizing issues of hash table and better ordering in redblack trees
c) because they can be implemented using trees
d) because they are balanced
View Answer
8. How can you save memory when storing color information in Red-Black tree?
a) using least significant bit of one of the pointers in the node for color information
b) using another array with colors of each node
c) storing color information in the node structure
d) using negative and positive numbering
View Answer
9. When to choose Red-Black tree, AVL tree and B-trees?
a) many inserts, many searches and when managing more items respectively
b) many searches, when managing more items respectively and many inserts
respectively
c) sorting, sorting and retrieval respectively
d) retrieval, sorting and retrieval respectively

1. What are splay trees?


a) self adjusting binary search trees
b) self adjusting binary trees
c) a tree with strings
d) a tree with probability distributions
View Answer
advertisement

2. Which of the following property of splay tree is correct?


a) it holds probability usage of the respective sub trees
b) any sequence of j operations starting from an empty tree with h nodes atmost, takes
O(jlogh) time complexity
c) sequence of operations with h nodes can take O(logh) time complexity
d) splay trees are unstable trees
View Answer
3. Why to prefer splay trees?
a) easier to program
b) space efficiency
c) easier to program and faster access to recently accessed items
d) quick searching
View Answer
4. Is it true that splay trees have O(logn) amortized complexity ?
a) true
b) false
View Answer
5. What is a splay operation?
a) moving parent node to down of child
b) moving a node to root
c) moving root to leaf
d) removing leaf node
View Answer
advertisement

6. Which of the following options is an application of splay trees?


a) cache Implementation
b) networks
c) send values
d) receive values
View Answer
7. When we have red-black trees and AVL trees that can perform most of operations in
logarithmic times, then what is the need for splay trees?
a) no there is no special usage
b) In real time it is estimated that 80% access is only to 20% data, hence most used
ones must be easily available
c) redblack and avl are not upto mark
d) they are just another type of self balancing binary search trees
View Answer
8. After the insertion operation, is the resultant tree a splay tee?

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

10. What is the disadvantage of using splay trees?


a) height of a splay tree can be linear when accessing elements in non decreasing
order.
b) splay operations are difficult
c) no significant disadvantage
d) splay tree performs unnecessary splay when a node is only being read
View Answer

You might also like