I/O & Disk Scheduling


Answer & solution
Answer: For zero-based disk coordinates and one-based n, j=((cL*t+tL)*s+sL)+(n−1); decode j by division. (no official key was published)
Assume disk coordinates cL,tL,sL are zero-based, records are numbered from 1, and the file starts at a sector boundary. Since each record equals one sector, record n is n−1 sectors beyond the initial address. Linearize the starting location as j0=(cL*t+tL)*s+sL and set j=j0+n−1.
Then cylinder=floor(j/(t*s)); within-cylinder remainder r=j mod(t*s); track=floor(r/s); sector=r mod s. These divisions automatically carry across track and cylinder boundaries. For n=1, quotient/remainder reconstruction returns exactly the starting triple. Crossing a sector boundary from s−1 adds one track; crossing track t−1 adds one cylinder.
Require 0≤j<C*t*s so the record fits on the disk. If sector labels are one-based, replace the starting sL by sL−1 before linearization and add 1 to the final sector result. If all three disk labels are one-based, first subtract 1 from each and then add 1 to each output. If records themselves are numbered from zero, use n rather than n−1. Without these conventions an off-by-one ambiguity remains; the physical addressing rule is otherwise the same.