The Gateway to Computer Science Excellence

+18 votes

Best answer

+10 votes

This is a question on simple indexing and so we should not bother about higher level of indexing..

So no of records given = n

no of records per data block given = 3

So no of data blocks = n / 3

Now we know in dense index ,

No of <key,pointer> pairs in dense index = No of data records

So

No of <key,pointer> pairs in 1st level index here = n

So no of index blocks = n/10 [ As there are 10 such pairs per index block]

**So total no of data blocks and index blocks required = n / 3 + n / 10**

** = 13 n / 30**

**Hence A) should be the correct answer..**

+2 votes

For $n$ records, blocks required = $\frac{n}{3}$

For $n$ indices in the index file, blocks required = $\frac{n}{10}$

Total = $\frac{n}{3}+\frac{n}{10}$ = $\frac{10n}{30}+\frac{3n}{30}$ = $\frac{13n}{30}$

**Option A**

Bonus:-

In case of sparse indexing:

For $n$ records, blocks required = $\frac{n}{3}$

For $\frac{n}{3}$ indices in the index file, blockes required = $\frac{n}{30}$

Total = $\frac{n}{3}+\frac{n}{30}$ = $\frac{10n}{30}+\frac{n}{30}$ = $\frac{11n}{30}$

For dense indexing, we have a pointer (index in the index file) for each record.

For sparse indexing, we have a pointer for each block. (More specifically for every first record of the block)

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,324 answers

198,405 comments

105,169 users