Skip to content

GATE CS question library

Practise GATE CS Computer Science previous year questions free. Browse by subject, syllabus topic, year and question type, with answers and available solutions.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

9 on this page
Official PYQ2004Compiler DesignParsing (LL, LR)MCQ · 1 mark
Which of the following grammar rules violate the requirements of an operator grammar? P,Q,RP, Q, R are nonterminals, and r,s,tr, s, t are terminals. P→QRP \rightarrow Q R P→QsRP \rightarrow Q s R P→ εP \rightarrow \: \varepsilon P→QtRrP \rightarrow Q t R r
Official PYQ2004Programming and Data StructuresArrays, Stacks and QueuesMCQ · 1 mark
Given the following input (4322,1334,1471,9679,1989,6171,6173,4199)(4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function xx mod 1010, which of the following statements are true? 9679,1989,41999679, 1989, 4199 hash to the same value 1471,61711471, 6171 hash to the same value All elements hash to the same value Each element hashes to a different value
Official PYQ2004Programming and Data StructuresTreesMCQ · 1 mark
Level order traversal of a rooted tree can be done by starting from the root and performing
Official PYQ2004Programming and Data StructuresArrays, Stacks and QueuesMCQ · 1 mark
The best data structure to check whether an arithmetic expression has balanced parentheses is a
Official PYQ2004Programming and Data StructuresBinary Search TreesMCQ · 1 mark
The following numbers are inserted into an empty binary search tree in the given order: 10,1,3,5,15,12,1610, 1, 3, 5, 15, 12, 16. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)?
Official PYQ2004Programming and Data StructuresArrays, Stacks and QueuesMCQ · 1 mark
A single array A[1…MAXSIZE]A[1 \ldots \text{MAXSIZE}] is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables top1top1 and top2top2 (top1<top2)(top1 < top 2) point to the location of the topmost element in each of the stacks. If the space is to be used efficiently, the condition for “stack full”\text{“}\textsf{stack full}\text{”} is
Official PYQ2004Compiler DesignRuntime EnvironmentsMCQ · 1 mark
Consider the following function void swap(int a, int b) { int temp; temp = a; a = b; b = temp; } In order to exchange the values of two variables xx and yy.
Official PYQ2004Programming and Data StructuresProgramming in CMCQ · 1 mark
The goal of structured programming is to:
Official PYQ2004Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageMCQ · 1 mark
Consider a system with a two-level paging scheme in which a regular memory access takes 150150 nanosecondsnanoseconds, and servicing a page fault takes 88 millisecondsmilliseconds. An average instruction takes 100100 nanoseconds of CPU time, and two memory accesses. The TLB hit ratio is 9090%, and the page fault rate is one in every 10,00010,000 instructions. What is …