14,331 views
35 votes
35 votes

Which of the following is correct?

  1. B-trees are for storing data on disk and B$^+$ trees are for main memory.

  2. Range queries are faster on B$^+$ trees.

  3. B-trees are for primary indexes and B$^+$ trees are for secondary indexes.

  4. The height of a B$^+$ tree is independent of the number of records.

3 Answers

Best answer
56 votes
56 votes
  1. False. Both r stored in disk
     
  2. True. By searching leaf level linearly in $B^+$ tree, we can say a node is present or not in $B^+$ tree. But for $B$ tree we have to traverse the whole tree
     
  3. False. $B$ tree and $B^+$ tree uses dynamic multilevel indexes http://home.iitj.ac.in/~ramana/ch10-storage-2.pdf
     
  4. False. Height depends on number of record and also max no of keys in each node (order of tree)

Correct Answer: $B$

edited by
10 votes
10 votes

The leaves (the bottom-most index blocks) of the B+ tree are often linked to one another in a linked list; this makes range queries or an (ordered) iteration through the blocks simpler and more efficient (though the aforementioned upper bound can be achieved even without this addition). This does not substantially increase space consumption or maintenance on the tree. This illustrates one of the significant advantages of a B+tree over a B-tree; in a B-tree, since not all keys are present in the leaves, such an ordered linked list cannot be constructed.
   read @ implementation http://en.wikipedia.org/wiki/B%2B_tree

reshown by
Answer:

Related questions

36 votes
36 votes
2 answers
1
39 votes
39 votes
2 answers
4
Kathleen asked Sep 23, 2014
19,634 views
Which of the following is/are correct?An SQL query automatically eliminates duplicatesAn SQL query will not work if there are no indexes on the relationsSQL permits attri...