Questions 931–940 of 975. Imported answers require independent review unless marked reviewed.

Topic practice 975 questionsPage 94 of 98

Question 43

Open question
CSNAT2 marksNeeds review
Consider the following snippet of a C program. Assume that swap(&x, &y) exchanges the contents of x and y.
int main() {
int array[] = {3, 5, 1, 4, 6, 2};
int done = 0;
int i;

while (done == 0) {
done = 1;
for (i=0; i<=4; i++) {
if (array[i] < array[i+1]) {
swap(&array[i], &array[i+1]);
done = 0;
}
}
for (i=5; i>=1; i--) {
if (array[i] > array[i-1]) {
swap(&array[i], &array[i-1]);
done = 0;
}
}
}
printf("%d", array[3]);
}
The output of the program is __________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 44

Open question
CSNAT2 marksNeeds review
In a RSA cryptosystem, a participant A uses two prime numbers

and

to generate her public and private keys. If the public key of A is 35, then the private key of A is __________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 44

Open question
CSNAT2 marksNeeds review
Two transactions

and

are given as


where

denotes a read operation by transaction

on a variable

and

denotes a write operation by transaction

on a variable

. The total number of conflict serializable schedules that can be formed by

and

is __________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 45

Open question
CSNAT2 marksNeeds review
The values of parameters for the Stop-and-Wait ARQ protocol are as given below: Bit rate of the transmission channel = 1 Mbps. Propagation delay from sender to receiver = 0.75 ms. Time to process a frame = 0.25 ms. Number of bytes in the information frame = 1980. Number of bytes in the acknowledge frame = 20. Number of overhead bytes in the information frame = 20.
Assume that there are no transmission errors. Then, the transmission efficiency (expressed in percentage) of the Stop-and-Wait ARQ protocol for the above parameters is __________ (correct to 2 decimal places).

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 45

Open question
CSNAT2 marksNeeds review
The read access times and the hit ratios for different caches in a memory hierarchy are as given below.
Cache
Read access time (in nanoseconds)
Hit ratio
I-cache
2
0.8
D-cache
2
0.9
L2-cache
8
0.9
The read access time of main memory is 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the write back policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program, 60% of memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is __________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 46

Open question
CSNAT2 marksNeeds review
Consider a database that has the relation schema CR(StudentName, CourseName). An instance of the schema CR is as given below.
StudentName
CourseName
SA
CA
SA
CB
SA
CC
SB
CB
SB
CC
SC
CA
SC
CB
SC
CC
SD
CA
SD
CB
SD
CC
SD
CD
SE
CD
SE
CA
SE
CB
SF
CA
SF
CB
SF
CC
The following query is made on the database


The number of rows in

is __________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 46

Open question
CSNAT2 marksNeeds review
Consider the following database table named

.
player
country
goals
Klose
Germany
16
Ronaldo
Brazil
15
G Müller
Germany
14
Fontaine
France
13
Pelé
Brazil
12
Klinsmann
Germany
11
Kocsis
Hungary
11
Batistuta
Argentina
10
Cubillas
Peru
10
Lato
Poland
10
Lineker
England
10
T Müller
Germany
10
Rahn
Germany
10
Consider the following SQL query:
SELECT ta.player FROM top_scorer AS ta
WHERE ta.goals >ALL (SELECT tb.goals
FROM top_scorer AS tb
WHERE tb.country = 'Spain')
AND ta.goals >ANY (SELECT tc.goals
FROM top_scorer AS tc
WHERE tc.country = 'Germany')
The number of tuples returned by the above SQL query is __________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 47

Open question
CSNAT2 marksNeeds review
The number of integers between 1 and 500 (both inclusive) that are divisible by 3 or 5 or 7 is __________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 47

Open question
CSNAT2 marksNeeds review
If the ordinary generating function of a sequence

is

, then

is equal to __________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 48

Open question
CSNAT2 marksNeeds review
Let

be an array of 31 numbers consisting of a sequence of 0’s followed by a sequence of 1’s. The problem is to find the smallest index

such that

is 1 by probing the minimum number of locations in

. The worst case number of probes performed by an optimal algorithm is __________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer