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

Remove earlier regions

18 - 4 - 4 = 10

row = 10 / 4 = 2; column = 10 % 4 = 2.

Return Double[2][2] after checking both bounds.

2 / 7

Predict the boundaries

Logical Address
3 Direct[3]
4 Indirect[0]
7 Indirect[3]
8 Double[0][0]
23 Double[3][3]
24 Out of range
3 / 7

Capacity and cost

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.

4 / 7

A hole keeps its position

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.

5 / 7

LOOK: do the movement sum

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.

6 / 7

Exit check

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.

7 / 7
←/→ or click edges to navigate · ? help · N notes · F fullscreen