Computer AwarenessHardIBPS SO IT Officer

Why are B+ trees preferred for database indexes that must also answer range queries such as 'balance between 10,000 and 50,000'?

  1. A. They store records in hash buckets, so each lookup takes one step
  2. B. All records sit in linked, ordered leaves, so a range is read leaf by leaf
  3. C. They keep every record in the root node, so no disk access is needed
  4. D. They are unbalanced, so recent keys are found faster than old ones

Correct answer: B. All records sit in linked, ordered leaves, so a range is read leaf by leaf

A B+ tree keeps data pointers only in leaves, which are chained in key order; after finding the first key, the scan just follows the leaf links. Hash indexes cannot do ranges.

हिंदी में

डेटाबेस इंडेक्स के लिए B+ ट्री को वरीयता क्यों दी जाती है जिन्हें ‘शेष 10,000 और 50,000 के बीच’ जैसे रेंज क्वेरी भी हल करनी होती हैं?

  1. A. वे रिकॉर्ड हैश बकेट में रखते हैं, इसलिए प्रत्येक खोज में एक चरण लगता है
  2. B. सभी रिकॉर्ड जुड़े, क्रमबद्ध पत्तों में रहते हैं, इसलिए रेंज पत्ता-दर-पत्ता पढ़ी जाती है
  3. C. वे प्रत्येक रिकॉर्ड को रूट नोड में रखते हैं, इसलिए डिस्क एक्सेस की आवश्यकता नहीं
  4. D. वे असंतुलित होते हैं, इसलिए हाल की कुंजियाँ पुरानी से तेज़ मिलती हैं

उत्तर: B. B+ ट्री डेटा पॉइंटर केवल पत्तों में रखता है, जो कुंजी क्रम में जंजीर की तरह जुड़े होते हैं; पहली कुंजी मिलने के बाद स्कैन केवल पत्ता-लिंकों का अनुसरण करता है। हैश इंडेक्स रेंज नहीं कर सकते।

More Computer Awareness questions

Exams that ask this topic