Computer Science and Information Technology
2019 · Paper 1
Take it one question at a time. Try an answer, then check your understanding.
Complete GATE CSE 2019 Paper 1 overview, original pages and practice · Timed previous-paper practice
Questions 28–30 of 65. Imported answers require review unless explicitly marked reviewed.
Question 18
Open questionCSNAT1 markNeeds review
Consider the following C program:
#include <stdio.h>
int jumble(int x, int y){
x=2*x+y;
return x;
}
int main(){
int x=2, y=5;
y=jumble(y,x);
x=jumble(y,x);
printf("%d \n", x);
return 0;
}
The value printed by the program is __________.
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 answerQuestion 19
Open questionCSNAT1 markNeeds review
Consider the grammar given below:
S → Aa
A → BD
B → b | ε
D → d | ε
Let a, b, d, and $ be indexed as follows:
a | b | d | $ |
|---|---|---|---|
3 | 2 | 1 | 0 |
Compute the FOLLOW set of the non-terminal B and write the index values for the symbols in the FOLLOW set in the descending order. (For example, if the FOLLOW set is , then the answer should be 3210)
Answer: __________.
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 answerQuestion 20
Open questionCSNAT1 markNeeds review
An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot element gets placed in the worst possible location in the first round of partitioning (rounded off to 2 decimal places) is ________.
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