1
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
Consider three processes (process id $$0,1,2,$$ respectively) with compute time bursts $$2, 4,$$ and $$8$$ time units. All processes arrive at time zero. Consider the longest remaining time first $$(LRTF)$$ scheduling algorithm. In $$LRTF$$ ties are broken by giving priority to the process with the lowest process id. The average turn around time is
A
$$13$$ units
B
$$14$$ units
C
$$15$$ units
D
$$16$$ units
2
GATE CSE 2006
MCQ (Single Correct Answer)
+1
-0.3
Consider three $$CPU$$-intensive process, which require $$10,20$$ and $$30$$ time units and arrive at times $$0,2$$ and $$6$$ respectively. How many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end.
A
$$1$$
B
$$2$$
C
$$3$$
D
$$4$$
3
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
Consider this C code to swap two integers and these five statements:
void swap(int *px, int *py) 
{ 
    *px = *px - *py; 
    *py = *px + *py; 
    *px = *py - *px; 
}
S1: will generate a compilation error

S2: may generate a segmentation fault at runtime depending on the arguments passed

S3: correctly implements the swap procedure for all input pointers referring to integers stored in memory locations accessible to the process

S4: implements the swap procedure correctly for some but not all valid input pointers

S5: may add or subtract integers and pointers.
A
S1
B
S2 and S3
C
S2 and S4
D
S2 and S5
4
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
If $$s$$ is a string over $${\left( {0 + 1} \right)^ * }$$ then let $${n_0}\left( s \right)$$ denote the number of $$0'$$ s in $$s$$ and $${n_1}\left( s \right)$$ the number of $$1'$$s in $$s.$$ Which one of the following languages is not regular?
A
$$L = \left\{ {s \in {{\left( {0 + 1} \right)}^ * }\left| {{n_0}\left( s \right)\,\,} \right.} \right.$$ is a $$3$$-digit prime$$\left. \, \right\}$$
B
$$L = \left\{ {s \in {{\left( {0 + 1} \right)}^ * }\left| {\,\,} \right.} \right.$$ for every prefix $$s'$$ of $$s.$$ $$\,\left| {{n_0}\left( {{s^,}} \right) - {n_1}\left( {{s^,}} \right)\left| { \le \left. 2 \right\}} \right.} \right.$$
C
$$L = \left\{ {s \in {{\left( {0 + 1} \right)}^*}\left\| {{n_0}\left( s \right) - {n_1}\left( s \right)\left| { \le \left. 4 \right\}} \right.} \right.} \right.$$
D
$$L = \left\{ {s \in {{\left( {0 + 1} \right)}^ * }} \right.\left| {{n_0}\left( s \right)} \right.$$ mod $$7 = {n_1}\left( s \right)$$ mod $$5 = \left. 0 \right\}$$
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12