ISRO Scientist/Engineer Question Paper Computer Science 2018

66. Question

Of the following sorting algorithms, which has a running time that is least dependent on the initial ordering of the input?




Answer
67. Question

Processes P1 and P2 have a producer-consumer relationship, communicating by the use of a set of shared buffers.
P1: repeat
Obtain an empty buffer
Fill it
Return a full buffer
forever
P2: repeat
Obtain a full buffer
Empty it
Return an empty buffer
forever
Increasing the number of buffers is likely to do which of the following?
I. Increase the rate at which requests are satisfied (throughput)
II. Decrease the likelihood of deadlock
III. Increase the ease of achieving a correct implementation




Answer
68. Question

In multi-programmed systems, it is advantageous if some programs s such as editors and compilers can be shared by several users.
Which of the following must be true of multi-programmed systems in order that a single copy of a program can be shared by several users?
I. The program is a macro
II. The program is recursive
III. The program is reentrant




Answer
69. Question

Let P be a procedure that for some inputs calls itself ( i.e. is recursive ). If P is guaranteed to terminate, which of the following statement(s) must be true?
I. P has a local variable
II. P has an execution path where it does not call its itself
III. P either refers to a global variable or has at least one parameter




Answer
70. Question

Consider the following C program
#include <stdio.h>
main()
{
float sum = 0.0 , j = 1.0, i = 2.0;
while ( i/j > 0.001 ){
j = j + 1;
sum = sum + i/j ;
printf ( “%f
”, sum );

}
}
How many lines of output does this program produce?




Answer