Joint Entrance Examination

Graduate Aptitude Test in Engineering

Strength of Materials Or Solid Mechanics

Structural Analysis

Construction Material and Management

Reinforced Cement Concrete

Steel Structures

Geotechnical Engineering

Fluid Mechanics and Hydraulic Machines

Hydrology

Irrigation

Geomatics Engineering Or Surveying

Environmental Engineering

Transportation Engineering

Engineering Mathematics

General Aptitude

1

Suppose you are provided with the following function declaration in the C programming language.
^{th} smallest element in an array a[ ] of size n using the partition function. We assume k≤n.

`int partition(int a[], int n);`

The function treats the first element of a[ ] as a pivot and rearranges the array so that all elements less than or equal to the pivot is in the left part of the array, and all elements greater than the pivot is in the right part. In addition, it moves the pivot so that the pivot is the last element of the left part. The return value is the number of elements in the left part.
The following partially given function in the C programming language is used to find the k```
int kth_smallest (int a[], int n, int k)
{
int left_end = partition (a, n);
if (left_end+1==k) {
return a[left_end];
}
if (left_end+1 > k) {
return kth_smallest (___________);
} else {
return kth_smallest (___________);
}
}
```

The missing arguments lists are respectivelyA

(a, left_end, k) and (a + left_end + 1, n - left_end - 1, k - left_end - 1)

B

(a, left_end, k) and (a, n - left_end - 1, k - left_end-1)

C

(a + left_end + 1, n - left_end - 1, k - left_end - 1) and (a, left_end, k)

D

(a, n - left_end - 1, k - left_end - 1) and (a, left_end, k)

2

Match the following:

GROUP 1 | GROUP 2 |
---|---|

P. Lexical analysis | 1. Graph coloring |

Q. Parsing | 2. DFA minimization |

R. Register allocation | 3. Post-order traversal |

S. Expression evaluation | 4. Production tree |

A

$$P - 2,\,\,Q - 3,\,\,R - 1,\,\,S - 4$$

B

$$P - 2,\,\,Q - 1,\,\,R - 4,\,\,S - 3$$

C

$$P - 2,\,\,Q - 4,\,\,R - 1,\,\,S - 3$$

D

$$P - 2,\,\,Q - 3,\,\,R - 4,\,\,S - 1$$

3

In the context of abstract-syntax-tree $$(AST)$$ and control-flow-graph $$(CFG),$$ which one of the following is TRUE?

A

In both $$AST$$ and $$CFG,$$ let node $${N_2}$$ be the successor of node $${N_1}.$$ In the input program, the code corresponding to $${N_2}$$ is present after the code corresponding to $${N_1}$$

B

For any input program, neither $$AST$$ nor $$CFG$$ will contain a cycle

C

The maximum number of successors of a node in an $$AST$$ and a $$CFG$$ depends on the input program

D

Each node in $$AST$$ and $$CFG$$ corresponds to at most one statement in the input program

4

Consider the intermediate code given below.

```
(1) i = 1
(2) j = 1
(3) t1 = 5 ∗ i
(4) t2 = t1 + j
(5) t3 = 4 ∗ t2
(6) t4 = t3
(7) a[t4] = -1
(8) j = j + 1
(9) if j<=5 goto (3)
(10) i=i+1
(11) if i<5 goto (2)
```

The number of nodes and edges in the control-flow-graph constructed for the above code, respectively, are

A

5 and 7

B

6 and 7

C

5 and 5

D

7 and 8

Subject Name | Total Questions |
---|---|

Algorithms | 5 |

Compiler Design | 3 |

Computer Networks | 6 |

Computer Organization | 4 |

Data Structures | 3 |

Database Management System | 4 |

Digital Logic | 3 |

Discrete Mathematics | 12 |

Operating Systems | 4 |

Programming Languages | 3 |

Software Engineering | 3 |

Theory of Computation | 4 |

Web Technologies | 1 |

GATE CSE 2021 Set 2

GATE CSE 2021 Set 1

GATE CSE 2020

GATE CSE 2019

GATE CSE 2018

GATE CSE 2017 Set 2

GATE CSE 2017 Set 1

GATE CSE 2016 Set 2

GATE CSE 2016 Set 1

GATE CSE 2015 Set 3

GATE CSE 2015 Set 2

GATE CSE 2015 Set 1

GATE CSE 2014 Set 2

GATE CSE 2014 Set 3

GATE CSE 2014 Set 1

GATE CSE 2013

GATE CSE 2012

GATE CSE 2011

GATE CSE 2010

GATE CSE 2009

GATE CSE 2008

GATE CSE 2007

GATE CSE 2006

GATE CSE 2005

GATE CSE 2004

GATE CSE 2003

GATE CSE 2002

GATE CSE 2001

GATE CSE 2000

GATE CSE 1999

GATE CSE 1998

GATE CSE 1997

GATE CSE 1996

GATE CSE 1995

GATE CSE 1994

GATE CSE 1993

GATE CSE 1992

GATE CSE 1991

GATE CSE 1990

GATE CSE 1989

GATE CSE 1988

GATE CSE 1987