PREVIOUS YEAR SOLVED PAPERS MCQ - GATE 2018

Correct AnswerOption B
Rate difficulty Rate difficulty:
Choose a difficulty.

I {ambncpdq | m + p = n + q} is clearly CFL since, we can rearrange the equation as m - n + p - q = 0 which can be done by push, pop, and pop and check if stack is empty at end.
II {ambncpdq | m = n and p = q} is clearly CFL since, one comparison at a time can be done by pda
III {ambncpdq | m = n = p and p ≠ q} is not CFL since m = n = p is a double comparison which cannot be done by PDA.
IV {ambncpdq | mn = p + q} is not a CFL, since mn involves multiplying number of a’s and number b’s which cannot be done by a PDA.
So, only I and II are CFL’s.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption B
Rate difficulty Rate difficulty:
Choose a difficulty.

// n takes 2^40
unsigned long int fun(unsigned long int n) {
// initialized sum = 0
unsigned long int i, j, sum = 0;
//First it takes i = n = 2^40,
//then it divides i by 2 and incremented once j
//each time, that's will make makes j = 40,
for( i=n; i>1; i=i/2) j++;
//Now the value of j = 40,
//it divides j by 2 and incremented once sum
//each time, that's will make makes sum = 5,
for( ; j>1; j=j/2) sum++;
//returns sum = 5
return sum;
}
So, answer is 5.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.
Found this useful?
Follow:


Given query: r ⋈ ( σB<5(s))
ABC
a12c1
a24c1
a34c1

A: σB<5(r ⋈ s)
ABC
a12c1
a24c1
a34c1

B:  σB<5(r ⋈ s)
ABC
a12c1
a24c1
a34c1

C: r ⋈ (σB<5(s))
ABC
a12c1
a24c1
a34c1
a46Null
a56Null

D: σ;B<5 (r) ⋈  s
ABC
a12c1
a24c1
a34c1

Option “C” query result not equal to given query.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption A
Rate difficulty Rate difficulty:
Choose a difficulty.
Max needCurrent allocationCurrent availableRemaining need
 EFGEFGE(3)F(3)G(0)EFG
P0431101431330
P1214112534102
P2133103646030
P3541200846341

Safe sequence : P0, P2, P1, P3
Safe state
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.

Total number of scalar multiplications are 48 + 75 + 50 + 2000 = 2173 and optimal parenthesis is ((F1(F2(F3 F4))) F5). As concluded, F3, F4 are explicitly computed pairs.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Why Practice with Avatto?
High Quality MCQsExam-focused questions with accurate answers
Detailed ExplanationsStep-by-step explanations to enhance learning
Latest Exam PatternBased on updated syllabus and pattern
Performance AnalyticsTrack performance and improve weak areas
100% Free PracticePractice unlimited questions for free
Boost Your PreparationAttempt mock tests, previous year papers and topic-wise quizzes.Explore All Tests →