GATE 2015 (Session 3)
65 questions
MCQ 45 · NAT 201-mark 30 · 2-mark 35
Questions 36–40 of 65
The velocity v (in kilometer/minute) of a motorbike which starts from rest, is given at fixed intervals of time t (in minutes) as follows:
The approximate distance (in kilometers) rounded to two places of decimals covered in 20 minutes using Simpson's rule is _______________.
The approximate distance (in kilometers) rounded to two places of decimals covered in 20 minutes using Simpson's rule is _______________.
Answer: 308 to 310
The distance is the area under the speed-time curve, . At the bike is at rest, so . This gives 11 points at min, i.e. 10 intervals (an even number, as Simpson's 1/3 rule needs).
Here and .
Odd points (t = 2, 6, 10, 14, 18):
Even interior points (t = 4, 8, 12, 16):
This is about 310 km.
Answer: 310
Here and .
Odd points (t = 2, 6, 10, 14, 18):
Even interior points (t = 4, 8, 12, 16):
This is about 310 km.
Answer: 310
Assume that a mergesort algorithm in the worst case takes 30 seconds for an input of size 64. Which of the following most closely approximates the maximum input size of a problem that can be solved in 6 minutes?
Answer: (B)
The time taken by mergesort is . Take n = 64: 64 6 = 384 units, and this takes 30 s.
6 minutes is 12 times 30 s, so we get 12 30 s 12 384 = 4608 units.
Now check n = 512: 512 9 = 4608
Answer: 512
6 minutes is 12 times 30 s, so we get 12 30 s 12 384 = 4608 units.
Now check n = 512: 512 9 = 4608
Answer: 512
Consider the following recursive C function.
void get(int n)
{
if (n<1) return;
get(n-1);
get(n-3);
printf("%d", n);
} If get(6) function is being called in main()then how many times will the get()function be invoked before returning to the main()?Answer: (B)
Let C(n) be the number of calls made by get(n). When n 1, C(n) = 1. Otherwise, C(n) = 1 + C(n1) + C(n3).
Now find the values one by one:
- C(1) = 1 + 1 + 1 = 3
- C(2) = 1 + 3 + 1 = 5
- C(3) = 1 + 5 + 1 = 7
- C(4) = 1 + 7 + 3 = 11
- C(5) = 1 + 11 + 5 = 17
- C(6) = 1 + 17 + 7 = 25
Answer: 25
Now find the values one by one:
- C(1) = 1 + 1 + 1 = 3
- C(2) = 1 + 3 + 1 = 5
- C(3) = 1 + 5 + 1 = 7
- C(4) = 1 + 7 + 3 = 11
- C(5) = 1 + 11 + 5 = 17
- C(6) = 1 + 17 + 7 = 25
Answer: 25
Consider a B+ tree in which the search key is 12 bytes long, block size is 1024 bytes, record pointer is 10 bytes long and block pointer is 8 bytes long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is ____________.
Answer: 50
If a non-leaf node has n block pointers, it holds n 1 keys. Use the block size to find n:
So the number of keys is 51 1 = 50.
Answer: 50
So the number of keys is 51 1 = 50.
Answer: 50
Given the function F=P'+QR , where F is a function in three Boolean variables P,Q and R and P'=!P, consider the following statements.
(S1) F=(4,5,6)
(S2) F=(0,1,2,3,7)
(S3) F=(4,5,6)
(S4) F=(0,1,2,3,7)
Which of the following is true?
(S1) F=(4,5,6)
(S2) F=(0,1,2,3,7)
(S3) F=(4,5,6)
(S4) F=(0,1,2,3,7)
Which of the following is true?
Answer: (A)
F = P' + QR equals 1 when P = 0 (minterms 0, 1, 2, 3). It also equals 1 when P = Q = R = 1 (minterm 7).
- Sum of minterms: So S2 is True and S1 is False.
- The remaining terms are the maxterms: So S3 is True and S4 is False.
Answer: (S1) False, (S2) True, (S3) True, (S4) False
- Sum of minterms: So S2 is True and S1 is False.
- The remaining terms are the maxterms: So S3 is True and S4 is False.
Answer: (S1) False, (S2) True, (S3) True, (S4) False