Question 1 |
Consider the following C function.
float f(float x, int y)
{
float p, s; int i;
for (s=1, p=1, i=1; i < y; i ++)
{
p*= x/i;
s+=p;
}
return s;
}
For large values of y, the return value of the function f best approximatesx^{y} | |
e^{x} | |
ln(1+x) | |
x^{x} |
Question 1 Explanation:
Question 2 |
Assume the following C variable declaration
int *A [10], B[10][10];
Of the following expressions
I A[2]
II A[2][3]
III B[1]
IV B[2][3]
which will not give compile-time errors if used as left hand sides of assignment statements in a C program?
int *A [10], B[10][10];
Of the following expressions
I A[2]
II A[2][3]
III B[1]
IV B[2][3]
which will not give compile-time errors if used as left hand sides of assignment statements in a C program?
I, II, and IV only | |
II, III, and IV only | |
II and IV only | |
IV only |
Question 2 Explanation:
Question 3 |
Let P(E) denote the probability of the event E. Given P(A) = 1, P(B) = 1/2, the values of P(A|B) and P(B|A) respectively are
1/4,1/2 | |
1/2, 1/14 | |
1/2, 1 | |
1, 1/2 |
Question 3 Explanation:
Question 4 |
Let A be a sequence of 8 distinct integers sorted in ascending order. How many distinct pairs of sequences, B and C are there such that
(i) each is sorted in ascending order,
(ii) B has 5 and C has 3 elements, and
(iii) the result of merging B and C gives A?
(i) each is sorted in ascending order,
(ii) B has 5 and C has 3 elements, and
(iii) the result of merging B and C gives A?
2 | |
30 | |
56 | |
256 |
Question 4 Explanation:
Question 5 |
n couples are invited to a party with the condition that every husband should be accompanied by his wife. However, a wife need not be accompanied by her husband. The number of different gatherings possible at the party is
\binom{2n}{n}*2^{n} | |
3^{n} | |
\frac{(2n)!}{2^{n}}
| |
\binom{2n}{n} |
Question 5 Explanation:
Question 6 |
Let T(n) be the number of different binary search trees on n distinct elements.
Then T(n)=\sum_{k=1}^{n}T(k-1)T(x),
where x is
Then T(n)=\sum_{k=1}^{n}T(k-1)T(x),
where x is
n-k+1 | |
n-k | |
n-k-1 | |
n-k-2 |
Question 6 Explanation:
Question 7 |
Consider the set \Sigma ^{*} of all strings over the alphabet \Sigma ={0,1}. \Sigma ^{*} with the
concatenation operator for strings
does not form a group | |
forms a non-commutative group | |
does not have a right identity element | |
forms a group if the empty string is removed from \Sigma ^{*} |
Question 7 Explanation:
Question 8 |
Let G be an arbitrary graph with n nodes and k components. If a vertex is
removed from G, the number of components in the resultant graph must necessarily
lie between.
k and n | |
k-1 and k+1 | |
k-1 and n-1 | |
k+1 and n-k |
Question 8 Explanation:
Question 9 |
Assuming all numbers are in 2's complement representation, which of the following
number is divisible by 11111011?
11100111 | |
11100100 | |
11010111 | |
11011011 |
Question 9 Explanation:
Question 10 |
For a pipelined CPU with a single ALU, consider the following situations
1. The (j + 1)-th instruction uses the result of j-th instruction as an operand
2. The execution of a conditional jump instruction
3. The j - th and j + 1 - st instructions require the ALU at the same time
Which of the above can cause a hazard?
1. The (j + 1)-th instruction uses the result of j-th instruction as an operand
2. The execution of a conditional jump instruction
3. The j - th and j + 1 - st instructions require the ALU at the same time
Which of the above can cause a hazard?
1 and 2 only | |
2 and 3 only | |
3 only | |
All the three |
Question 10 Explanation:
There are 10 questions to complete.