Question 51
Question 52
Let G be a directed graph whose vertex set is the set of numbers from 1 to 100. There is an edge from a vertex i to a vertex j if either j = i + 1 or j = 3i. The minimum number of edges in a path in G from vertex 1 to vertex 100 is
Question 53
#include<stdio.h>
int f(int n, int k)
{
if (n == 0)
return 0;
else if (n % 2)
return f(n/2, 2*k) + k;
else return f(n/2, 2*k) - k;
}
int main ()
{
printf(\"%d\", f(20, 1));
return 0;
}
Question 54
i = 0;
j = 1;
while (j < n )
{
if (E) j++;
else if (a[j] - a[i] == S) break;
else i++;
}
if (j < n)
printf(\"yes\")
else
printf (\"no\");
Choose the correct expression for E.
Question 55
Question 56
Process | Priority | CPU time required | Arrival time (hh:mm:ss) |
P1 | 10(highest) | 20 sec | 00:00:05 |
P2 | 9 | 10 sec | 00:00:03 |
P3 | 8 (lowest) | 15 sec | 00:00:00 |
We have a choice of preemptive or non-preemptive scheduling. In preemptive scheduling, a late-arriving higher priority process can preempt a currently running process with lower priority. In non-preemptive scheduling, a late-arriving higher priority process must wait for the currently executing process to complete before it can be scheduled on the processor.
What are the turnaround times (time from arrival till completion) of P2 using preemptive and non-preemptive scheduling respectively.
Question 57
Consider a 2-way set associative cache memory with 4 sets and total 8 cache blocks (0-7) and a main memory with 128 blocks (0-127). What memory blocks will be present in the cache after the following sequence of memory block references if LRU policy is used for cache block replacement. Assuming that initially the cache did not have any memory block from the current job? 0 5 3 9 7 0 16 55
Question 58
In a computer system, four files of size 11050 bytes, 4990 bytes, 5170 bytes and 12640 bytes need to be stored. For storing these files on disk, we can use either 100 byte disk blocks or 200 byte disk blocks (but can\'t mix block sizes). For each block used to store a file, 4 bytes of bookkeeping information also needs to be stored on the disk. Thus, the total space used to store a file is the sum of the space taken to store the file and the space taken to store the book keeping information for the blocks allocated for storing the file. A disk block can store either bookkeeping information for a file or data from a file, but not both. What is the total space required for storing the files using 100 byte disk blocks and 200 byte disk blocks respectively?
Question 59
Question 60
There are 90 questions to complete.