Questions 301–310 of 534. Imported answers require independent review unless marked reviewed.

Topic practice 534 questionsPage 31 of 54

Question 30

Open question
CSMCQ2 marksNeeds review
Consider the following recurrence relation.

Which one of the following options is correct?
Your answerChoose one option.

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
CSMCQ2 marksNeeds review
Consider the following ANSI C code segment:
z = x + 3 + y->f1 + y->f2;
for (i = 0; i < 200; i = i + 2){
if (z > i) {
p = p + x + 3;
q = q + y->f1;
} else {
p = p + y->f2;
q = q + x + 3;
}
}
Assume that the variable y points to a struct (allocated on the heap) containing two fields f1 and f2, and the local variables x, y, z, p, q, and i are allocated in registers. Common sub-expression elimination (CSE) optimization is applied on the code. The number of addition and dereference operations (of the form y->f1 or y->f2) in the optimized code, respectively, are:
Your answerChoose one option.

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
CSMCQ2 marksNeeds review
Consider the following context-free grammar where the set of terminals is

.\n\n

\n\n

\n\n

\n\nThe following is a partially-filled LL(1) parsing table. ("blank" denotes that the corresponding cell is empty.)\n\n| |

|

|

|

|

|

|\n|---|---|---|---|---|---|---|\n|

| ① | | |

| ② | |\n|

|

|

| ③ | |

| ④ |\n|

| | |

| |

| |\n\nWhich one of the following choices represents the correct combination for the numbered cells in the parsing table?
Your answerChoose one option.

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
CSMCQ2 marksNeeds review
The relation scheme given below is used to store information about the employees of a company, where empId is the key and deptId indicates the department to which the employee is assigned. Each employee is assigned to exactly one department.
emp(empId, name, gender, salary, deptId)
Consider the following SQL query:
select deptId, count(*)
from emp
where gender = "female" and salary > (select avg(salary) from emp)
group by deptId;
The above query gives, for each department in the company, the number of female employees whose salary is greater than the average salary of
Your answerChoose one option.

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
CSMCQ2 marksNeeds review
Let

and

denote read and write operations respectively on a data item

by a transaction

. Consider the following two schedules.


Which one of the following options is correct?
Your answerChoose one option.

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
CSMCQ2 marksNeeds review
Let S be the following schedule of operations of three transactions T₁, T₂ and T₃ in a relational database system:
R₂(Y), R₁(X), R₃(Z), R₁(Y), W₁(X), R₂(Z), W₂(Y), R₃(X), W₃(Z)
Consider the statements P and Q below:
P: S is conflict-serializable. Q: If T₃ commits before T₁ finishes, then S is recoverable.
Which one of the following choices is correct?
Your answerChoose one option.

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
CSMCQ2 marksNeeds review
Consider the relation

with the following functional dependencies.

Consider the decomposition of the relation

into the constituent relations according to the following two decomposition schemes.


Which one of the following options is correct?
Your answerChoose one option.

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
CSMCQ2 marksNeeds review
A bag has r red balls and b black balls. All balls are identical except for their colours. In a trial, a ball is randomly drawn from the bag, its colour is noted and the ball is placed back into the bag along with another ball of the same colour. Note that the number of balls in the bag will increase by one, after the trial. A sequence of four such trials is conducted. Which one of the following choices gives the probability of drawing a red ball in the fourth trial?
Your answerChoose one option.

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
CSMCQ2 marksNeeds review
Let

be a group of order 6, and

be a subgroup of

such that

. Which one of the following options is correct?
Your answerChoose one option.

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
CSMCQ2 marksNeeds review
Consider the cyclic redundancy check (CRC) based error detecting scheme having the generator polynomial

. Suppose the message

is to be transmitted. Check bits

are appended at the end of the message by the transmitter using the above CRC scheme. The transmitted bit string is denoted by

. The value of the check bit sequence

is
Your answerChoose one option.

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