Disk request received by a disk drive for cylinders 5, 25, 18,3, 39, 8 and 35 in that order. A seek takes 5 ms per cylinder moved. How much seek time is needed to serve the serequests fora Shortest Seek First (SSF) algorithm? Assume that the arm is at cylinder 20 when last of the request is made with none of the requests yet served.
-
Solution
The head will move in the following order :
Total moves = (20 – 18) + (25 – 18) + (35 –25) + (39 – 35) +(39 – 8) +(8 – 5) + (5 – 3) = 59
Seek takes 5 ms percylinder moved
⇒ Seek time= 5 × 59 = 295 ms
Consider the processes listed below {P1, P2, P3, P4 and P5}with the burst time and priority.Assume that all process arrive at time O.
Which of the following algorithm results in the minimum average waiting time (over all processes)?
-
Solution
SJF results in minimum waiting time of 4 s as Gantt chart
Which regular expression does not describe the language containing at least two 0’sand ends with 1 over alphabet {0, 1}.
-
Solution
0*0(0 + 1)*0(0 + 1)*1 also have at least two 0’s but it will never start with 1.
The following DFA accepts the set of all strings over [0, 1]
-
Solution
The strings accepted by above DFA are {^, 1, 10, 0, 01,00, 011, 011, 000111 .. only those contains at most two 0’s]
Consider the following propositional statements :
Which one of the following is true?
-
Solution
Which of the following grammar is an operator grammar?
-
Solution
Grammar with no ∈ production so that no consecutive symbols on RHS of productions are non-terminals, will be operator grammar.From the given option, only option (a) does not contain any grammar with ∈ production and consecutive non-terminal symbols on RHS.
Which of the following language is described by regular expression over [0, 1](0 + 1)*1*(0 +1)*0?
-
Solution
The regular expression generate
{0, 00, 10, 000, 110, 100, 110, .....}
all stringend with 0.
Consider two languages L1={anbm| n, m ≥ 1}and L2 ={anbm| n, m ≥ 1, n ≠ m}, which of the following is true.
-
Solution
There is the theorem which shows that intersection of are gular language and context free language is context free as L1 is regular and L2 is context free.
Consider the TM given below
If the above TM is started with some arbitrary binary string on tape, enclosed by blanks and with the read-write head on first bit of the string, then the final contents of tape after machine halts will be
-
Solution
The TM leaves the starting 0 and 1 as it is and then converts remainder of string to 0’s due to 0, 0, R and 1, 0, R combination of state B.
∴ (0 + 1) 0* enclosed by blanks will be the final contents of tape after TM halts in F
Consider the following languages :
Which statement is true?
-
Solution
L1 is not context-free but L2 is context-free grammar For L2,the grammar is
S → AT | ZB, A → 000 A1|∈ , B → 111B2|∈,T → 2T|∈,Z → 0Z|∈
For example, The string accepted by the above grammar is
S → AT S → ZB
→ 000 A12 T → 0Z111B2
→ 000000 A1122T → 00Z111111B22
→ 0000001122 → 0011111122