Top MCQs on B and B+ Trees with AnswersLast Updated : 27 Sep, 2023ReadDiscussCoursesB-Tree is known as a self-balancing tree as its nodes are sorted in the inorder traversal.B+ tree eliminates the drawback B-tree used for indexing by storing data pointers only at the leaf nodes of the tree.More on B and B+ TreesB and B+ tree QuizTop MCQs on B and B+ Trees with AnswersPlease wait while the activity loads.If this activity does not load, try refreshing your browser. Also, this page requires javascript. Please visit using a browser with javascript enabled.If loading fails, click here to try againQuestion 1Consider a B+-tree in which the maximum number of keys in a node is 5. What is the minimum number of keys in any non-root node? (GATE CS 2010)1234Top MCQs on B and B+ Trees with Answers Discuss itQuestion 1-Explanation: Since the maximum number of keys is 5, maximum number of children a node can have is 6. Bydefinition of B Tree, minimum children that a node can have would be 6/2 = 3. Therefore, minimum number of keys that a node can have becomes 2 (3-1)=4.Question 2Which one of the following is a key factor for preferring B-trees to binary search trees for indexing database relations?Database relations have a large number of recordsDatabase relations are sorted on the primary keyB-trees require less memory than binary search treesData transfer form disks is in blocks.Top MCQs on B and B+ Trees with Answers Discuss itQuestion 2-Explanation: A disk block contains fairly large number of keys. Unlike BST where each node contains only one key, B-Tree is designed to contain large number of keys so that tree height is small.Question 3B+ trees are preferred to binary trees in databases because (GATE CS 2000)Disk capacities are greater than memory capacitiesDisk access is much slower than memory accessDisk data transfer rates are much less than memory data transfer ratesDisks are more reliable than memoryTop MCQs on B and B+ Trees with Answers Discuss itQuestion 3-Explanation: Disk access is slow and B+ Tree provide search in less number of disk hits. This is primarily because unlike binary search trees, B+ trees have very high fanout (typically on the order of 100 or more), which reduces the number of I/O operations required to find an element in the tree.Question 4Which of the following is FALSE about B/B+ treeB/B+ trees grow upward while Binary Search Trees grow downward.Time complexity of search operation in B/B+ tree is better than Red Black Trees in general.Number of child pointers in a B/B+ tree node is always equals to number of keys in it plus one.A B/B+ tree is defined by a term minimum degree. And minimum degree depends on hard disk block size, key and address sizes.Top MCQs on B and B+ Trees with Answers Top 50 Data Structures MCQs with Answers Discuss itQuestion 4-Explanation: Asymptotic time complexity of both is of order logn.Question 5A B-tree of order 4 is built from scratch by 10 successive insertions. What is the maximum number of node splitting operations that may take place?3456GATE CS 2008 Top MCQs on B and B+ Trees with Answers Discuss itQuestion 5-Explanation: Insertion of 3 keys 10 20 30 Insertion of 4th key (1st split) 30 / \ 10*20 40 Insertion of 5th key no split To maximize splits, let us insert a value in a node that has key in access. Let us insert 5 30 / \ 5*10*20 40 Insertion of 6th key (2nd Split) To maximize splits, let us insert a value in a node that has key in access. Let us insert 8 8*30 / | \ 5 10*20 40 Insertion of 7th key To maximize splits, let us insert a value in a node that has key in access. Let us insert 15 8*30 / | \ 5 10*15*20 40 Insertion of 8th key (3rd Split) To maximize splits, let us insert a value in a node that has key in access. Let us insert 12 8*12*30 / / \ \ 5 10 15*20 40 Insertion of 9th key To maximize splits, let us insert a value in a node that has key in access. Let us insert 17 8*12*30 / / \ \ 5 10 15*17*20 40 Insertion of 10th key (4th and 5th Splits) To maximize splits, let us insert a value in a node that has key in access. Let us insert 13 12 / \ 8 15*30 / \ / | \ 5 10 13 17*20 40 Question 6The order of a leaf node in a tree B+ ? is the maximum number of (value, data record pointer) pairs it can hold. Given that the block size is 1K bytes, data record pointer is 7 bytes long, the value field is 9 bytes long and a block pointer is 6 bytes long, what is the order of the leaf node?63646768GATE-CS-2007 Top MCQs on B and B+ Trees with Answers Discuss itQuestion 6-Explanation: Disk Block size = 1024 bytes Data Record Pointer size, r = 7 bytes Value size, V = 9 bytes Disk Block ptr, P = 6 bytes Let order of leaf be m. A leaf node in B+ tree contains at most m record pointers, at most m values, and one disk block pointer.r*m + V*m + p <= 1024 16m <= 1018 m =< 63Question 7The order of an internal node in a B+ tree index is the maximum number of children it can have. Suppose that a child pointer takes 6 bytes, the search field value takes 14 bytes, and the block size is 512 bytes. What is the order of the internal node?24252627GATE-CS-2004 Top MCQs on B and B+ Trees with Answers Top 50 Data Structures MCQs with Answers Discuss itQuestion 7-Explanation: Key size = 14 bytes (given) Child pointer = 6 bytes (given)We assume the order of B+ tree to be ‘n’.Block size = (n - 1) * key size + n * child pointer 512 >= (n - 1) * 14 + n * 6 512 >= 14 * n – 14 + 6 * n n = (512 + 14) / 20 n = 526 / 20 n = 26.3 n = 26 Thus, option (C) is correct. Please comment below if you find anything wrong in the above post.Question 8Consider the following 2-3-4 tree (i.e., B-tree with a minimum degree of two) in which each data item is a letter. The usual alphabetical ordering of letters is used in constructing the tree. What is the result of inserting G in the above tree ? A) B) C) D) None of the above ABCDGATE-CS-2003 Top MCQs on B and B+ Trees with Answers Discuss itQuestion 8-Explanation: Since the given B tree is 2-3-4 tree, there can be at-most 4 children or 3 keys. In B Tree insertion, we start from root and traverse till the leaf node where key is to be inserted. While traversing, if we find a a node which full, we split it. When we insert G, we find root itself is full, so we split it. When we come down to leftmost leaf, we find that the leaf is also full, so we split the leaf also.Question 9A B+ -tree index is to be built on the Name attribute of the relation STUDENT. Assume that all student names are of length 8 bytes, disk block are size 512 bytes, and index pointers are of size 4 bytes. Given this scenario, what would be the best choice of the degree (i.e. the number of pointers per node) of the B+ -tree?16424344GATE-CS-2002 Top MCQs on B and B+ Trees with Answers Discuss itQuestion 9-Explanation: Size of 1 record = 8 + 4 = 12 Let the order be N. No. of index values per block = N - 1 (N - 1) 12 + 4 = 512 12N - 12 + 4 = 512 12N - 8 = 512 12N = 520 N = 520/12 N = 43.333Question 10With reference to the B+ tree index of order 1 shown below, the minimum number of nodes (including the root node) that must be fetched in order to satisfy the following query: “Get all records with a search key greater than or equal to 7 and less than 15” is ________ 4567GATE-CS-2015 (Set 2) Top MCQs on B and B+ Trees with Answers Discuss itQuestion 10-Explanation: We can get all values in range from 7 to 59 by accessing 5 nodes. 1) First search 7 in a leaf node. 2) Once 7 is found, linearly traverse till 15 is found. See following diagram 12 There are 16 questions to complete.You have completedquestionsquestionYour accuracy isCorrectWrongPartial-CreditYou have not finished your quiz. If you leave this page, your progress will be lost.Correct AnswerYou SelectedNot AttemptedFinal Score on QuizAttempted Questions CorrectAttempted Questions WrongQuestions Not AttemptedTotal Questions on QuizQuestion DetailsResultsDateScoreHintTime allowedminutessecondsTime usedAnswer Choice(s) SelectedQuestion Text All doneNeed more practice!Keep trying!Not bad!Good work!Perfect!