In: Computer Science
I. Fill in the blank by matching the high level construct correct number to the corresponding letter of the instruction sequence. Write one sentence to support your answer.
1. Access the disk block i.
2. Enqueue x into Q.
3. C= AX B where A, B, C are matrices.
4. Send file f to printer P.
5. Load program p into memory and execute p.
Copy f into a temporary file f'.
Wait until printer P not busy.
Reserve printer P.
Send file f' to printer P.
Release printer P.
____
for all i:
for all j:
for all k:
Cij = Cij + Aik x Bkj
_____
Given a file block i, determine the track number t and the block number j within t that correspond to block i. Access block j on track t.
_____
If program p is too large to fit into memory, divide p into
smaller partitions p1, p2, ...
Load p1 and start execution.
Whenever a different partition pi is needed, save current partition
and load pi.
Resume execution.
_____
Allocate new queue element e.
Copy x into e.
Insert e at rear of Q.
____
Answer A
Copy f into a temporary file f'.
Wait until printer P not busy.
Reserve printer P.
Send file f' to printer P.
Release printer P.
Here we are waiting for printer to get free.
4. Send file f to printer P.
Answer B
for all i:
for all j:
for all k:
Cij = Cij + Aik x Bkj
This is multiplication logic for square matrix.
3. C= AX B where A, B, C are matrices.
Answer C
Given a file block i, determine the track number t and the block number j within t that correspond to block i. Access block j on track t.
track, blocks (sector) are part of disk.
1. Access the disk block i.
Answer D
If program p is too large to fit into memory, divide p into
smaller partitions p1, p2, ...
Load p1 and start execution.
Whenever a different partition pi is needed, save current partition
and load pi.
Resume execution.
Here, we are loading particular page of program in memory and executing.
5. Load program p into memory and execute p.
Answer E
Allocate new queue element e.
Copy x into e.
Insert e at rear of Q.
Here we are creating new node e which has value x. New node is added as rear of queue.
2. Enqueue x into Q.