Questions 31–40 of 281. Imported answers require independent review unless marked reviewed.

Topic practice 281 questionsPage 4 of 29

Question 65

Open question
CSNAT2 marksNeeds review
Consider a relational database schema with a relation

. If

and

are the only two candidate keys of the relation

, then the number of superkeys of relation

is _____. (answer in integer)

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 65

Open question
CS2NAT2 marksNeeds review
It is necessary to design a link-layer protocol between two hosts that are directly connected over a lossless link of length 300 kilometers. Assume that the link bandwidth is

bits per second and that the propagation delay in the link is 5 nanoseconds per meter. Every transmitted data byte is assigned a unique sequence number.
Let

be the minimum number of bits needed for the sequence number field in the protocol header such that
i. the sequence numbers do not wrap around before 60 seconds, and ii. the maximum utilization of the link is achieved.
The value of

is ______. (answer in integer)

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 29

Open question
CSNAT1 markNeeds review
Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into I/O queue whenever an I/O related operation is performed. Assume that there will always be a context switch whenever a process requests for an I/O, and also whenever the process returns from an I/O. The number of times the process will enter the ready queue during its life time (not counting the time the process enters the ready queue when it is run initially) is ______. (Answer in integer)
int main()
{
int x=0,i=0;
scanf("%d",&x);
for(i=0; i<20; i++)
{
x = x+20;
printf("%d\n",x);
}
return 0;
}

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 30

Open question
CSNAT1 markNeeds review
Let

be the set of all ternary strings defined over the alphabet

. Consider all strings in

that contain at least one occurrence of two consecutive symbols, that is, “aa”, “bb” or “cc”. The number of such strings of length 5 that are possible is ______. (Answer in integer)

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 31

Open question
CSNAT1 markNeeds review
Consider the given function

.

If the function is differentiable everywhere, the value of

must be ______. (rounded off to one decimal place)

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 32

Open question
CSNAT1 markNeeds review
A box contains 5 coins: 4 regular coins and 1 fake coin. When a regular coin is tossed, the probability

and for a fake coin,

. You pick a coin at random and toss it twice, and get two heads. The probability that the coin you have chosen is the fake coin is ______. (rounded off to two 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 32

Open question
CSNAT1 markNeeds review
The following two signed 2’s complement numbers (multiplicand M and multiplier Q) are being multiplied using Booth’s algorithm:
M: 1100 1101 1110 1101 and Q: 1010 0100 1010 1010
The total number of addition and subtraction operations to be performed is __________. (Answer in integer)

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 33

Open question
CSNAT1 markNeeds review
The pseudocode of a function fun() is given below:
fun(int A[0,...,n-1]) {
for i=0 to n-2
for j=0 to n-i-2
if (A[j]>A[j+1])
then swap A[j] and A[j+1]
}
Let

be an array storing 30 distinct integers in descending order. The number of swap operations that will be performed, if the function fun() is called with

as argument, is __________. (Answer in integer)

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 33

Open question
CSNAT1 markNeeds review
The output of the given C code segment is ________. (Answer in integer)
int x=12,y=10;
do {
if(x>y) x=x-y;
else y=y-x;
} while(x!=y);

printf("%d",x);

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 34

Open question
CSNAT1 markNeeds review
#include <stdio.h>
void foo(int *p, int x){
*p=x;
}
int main(){
int *z;
int a = 20, b = 25;
z = &a;
foo(z,b);
printf("%d",a);
return 0;
}
The output of the given C program is __________. (Answer in integer)

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