Find Logical Block 18
Four direct pointers. Four entries per indirect table.
Which row and column of the double-indirect region contain logical block 18?
1 / 7
Four direct pointers. Four entries per indirect table.
Which row and column of the double-indirect region contain logical block 18?
18 - 4 - 4 = 10
row = 10 / 4 = 2; column = 10 % 4 = 2.
Return Double[2][2] after checking both bounds.
| Logical | Address |
|---|---|
| 3 | Direct[3] |
| 4 | Indirect[0] |
| 7 | Indirect[3] |
| 8 | Double[0][0] |
| 23 | Double[3][3] |
| 24 | Out of range |
Data capacity: D + F + F² = 24 blocks.
Fully populated pointer tables: 1 + 1 + F = 6 metadata blocks.
Slices in the simulator hide the metadata reads.
Double = [[60,61], [], [80]]
Logical 12 is missing; logical 16 maps to 80. Empty row 1 does not move row 2. -1 means missing; 0 is valid here.
Head 40, up, requests [15,55,25,70,55].
Order [55,55,70,25,15]; movement 15+0+15+45+10=85.
Reverse at 70. There is no trip to the disk boundary.
A request is exactly at the current head and direction is down.
Service it immediately for zero movement, then descend. Keep duplicates, and check an empty initial direction.