|
|
|
GATE Download Sample Question Papers |
GATE Download Sample Question Papers
GATE – Sample Questions - CSE2
Questions And Answers No. Question 1 Consider the following C function void swap (int a, int b) { int temp ; temp = a ; a = b ; b = temp ; } In order to exchange the values of two variables x and y. Options A) call swap (x, y) B) call swap (&x, &y) C) swap (x, y) cannot be used as it does not return any value D) swap (x, y) cannot be used as the parameters are passed by value Your Answer ( Not Answered ) Correct Answer B 2 A 5 stage pipelined CPU has the following sequence of stages: IF - Instruction fetch from instruction memory, RD - Instruction decode and register read, EX - Execute: ALU operation for data and address computation, MA - Data memory access - for write access, the register read at RD stage is used, WB - Register write back. Consider the following sequence of instructions: I 1 : L R0, 1oc1; R0 <= M[1oc1] I 2 : A R0, R0; R0 <= R0 + R0 I 3 : A R2, R0; R2 <= R2 - R0 Let each stage take one clock cycle. What is the number of clock cycles taken to complete the above sequence of instructions starting from the fetch of I 1 ? Options A) 8 B) 10 C) 12 D) 15 Your Answer ( Not Answered ) Correct Answer A 3 The address resolution protocol (ARP) is used for Options A) Finding the IP address from the DNS B) Finding the IP address of the default gateway C) Finding the IP address that corresponds to a MAC address D) Finding the MAC address that corresponds to an IP address Your Answer ( Not Answered ) Correct Answer D 4 Consider the following relation schema pertaining to a students database: Student ( rollno , name, address) Enroll ( rollno , courseno , coursename) where the primary keys are shown underlined. The number of tuples in the Student and Enroll tables are 120 and 8 respectively. What are the maximum and minimum number of tuples that can be present in (Student * Enroll), where ‘*'denotes natural join? Options A) 8, 8 B) 120, 8 C) 960, 8 D) 960, 120 Your Answer ( Not Answered ) Correct Answer C 5 Consider a direct mapped cache of size 32 KB with block size 32 bytes. The CPU generates 32 bit addresses. The number of bits needed for cache indexing and the number of tag bits are respectively Options A) 10, 17 B) 10, 22 C) 15, 17 D) 5, 17 Your Answer ( Not Answered ) Correct Answer A 6 Which one of the following is a key factor for preferring B + -trees to binary search trees for indexing database relations? Options A) Database relations have a large number of records B) Database relations are sorted on the primary key C) B + -trees require less memory than binary search trees D) Data transfer from disks is in blocks Your Answer ( Not Answered ) Correct Answer D 7 The goal of structured programming is to Options A) have well indented programs B) be able to infer the flow of control from the compiled code C) be able to infer the flow of control from the program text D) avoid the use of GOTO statements Your Answer ( Not Answered ) Correct Answer C 8 The tightest lower bound on the number of comparisons, in the worst ease, for comparison-based sorting is of the order of Options A) n B) n 2 C) n log n D) n log 2 n Your Answer ( Not Answered ) Correct Answer B 9 Consider the following two problems on undirected graphs a: Given G(V, E), does G have an independent set of size |V| -4? b: Given G(V, E), does G have an independent set of size 5? Which one of the following is TRUE? Options A) a is in P and b is NP-complete B) a is NP-complete and b is in P C) Both a and b are NP-complete D) Both a and b are in P Your Answer ( Not Answered ) Correct Answer C 10 Consider the languages L 1 = {ww R | w Î {0, 1}*} L 2 = {w# w R | w Î {0, 1}*}, where # is a special symbol L 3 = {ww | w Î {0, 1}*} Which one of the following is TRUE? Options A) L 1 is a deterministic CFL B) L 2 is a deterministic CFL C) L 3 is a CFL, but not a deterministic CFL D) L 3 is a deterministic CFL Your Answer ( Not Answered ) Correct Answer B 11 Let G be a simple graph with 20 vertices and 100 edges. The size of the minimum vertex cover of G is 8. Then, the size of the maximum independent set of G is Options A) 12 B) 8 C) Less than 8 D) More than 12 Your Answer ( Not Answered ) Correct Answer A 12 A and B are the only two stations on an Ethernet. Each has a steady queue of frames to send. Both A and B attempt to transmit a frame, collide, and A wins the first backoff race. At the end of this successful transmission by A, both A and B attempt to transmit and collide. The probability that A wins the second backoff race is Options A) 0.5 B) 0.625 C) 0.75 D) 1.0 Your Answer ( Not Answered ) Correct Answer A 13 Consider the grammar E ® E + n | E x n | n For a sentence n + n x n, the handles in the right-sentential form of the reduction are Options A) n, E + n and E + n x n B) n, E + n and E + E x n C) n, n + n and n + n x n D) n, E + n and E x n Your Answer ( Not Answered ) Correct Answer D 14 Consider the grammar with the following translation rules and E as the start symbol. E ® E 1 # T {E.value = E 1 .value * T.value } | T {E.value = T.value } T ® T 1 & F { T.value = T 1 .value + F.value } | F {T.value = F.value} F ® num {F.value = num.value } Compute E. value for the root of the parse tree for the expression: 2 # 3 & 5 # 6 & 4. Options A) 200 B) 180 C) 160 D) 40 Your Answer ( Not Answered ) Correct Answer C 15 Let A be a sequence of 8 distinct integers sorted in ascending order. How many distinct pairs of sequences, B and C are there such that (i) each is sorted in ascending order, (ii) B has 5 and C has 3 elements, and (iii) the result of merging B and C gives A? Options A) 2 B) 30 C) 56 D) 256 Your Answer ( Not Answered ) Correct Answer D 16 Which one of the following is true for a CPU having a single interrupt request line and a single interrrupt grant line? Options A) Neither vectored interrupt nor multiple interrupting devices are possible. B) Vectored interrupts are not possible but multiple interrupting devices are possible. C) Vectored interrupts and multiple interrupting devices are both possible. D) Vectored interrupt is possible but multiple interrupting devices are not possible. Your Answer ( Not Answered ) Correct Answer B 17 Consider a relation scheme R = (A, B, C, D, E, H) on which the following functional dependencies hold : (A ® B, BC ® D, E ® C, D ® A). What are the candidate keys of R? Options A) AE, BE B) AE, BE, DE C) AEH, BEH, BCH D) AEH, BEH, DEH Your Answer ( Not Answered ) Correct Answer D 18 In a network of LANs connected by bridges, packets are sent from one LAN to another through intermediate bridges. Since more than one path may exist between two LANs, packets may have to be routed through multiple bridges.
Why is the spanning tree algorithm used for bridge-routing? Options A) For shortest path routing between LANs B) For avoiding loops in the routing paths C) For fault tolerance D) For minimizing collisions Your Answer ( Not Answered ) Correct Answer B 19 Suppose T(n) = 2T (n/2) + n, T(0) = T(1) = 1 Which one of the following is FALSE? Options A) T(n) = O(n 2 ) B) T(n) = q (n log n) C) T(n) = W (n 2 ) D) T(n) = O(n log n) Your Answer ( Not Answered ) Correct Answer B 20 Consider the following C program segment struct CellNode { struct CellNode *leftChild ; int element; struct CellNode *rightChild ; }; int DoSomething (struct CellNode *ptr) { int value = 0 ; if (ptr ! = NULL) { if (ptr->leftChild ! = NULL) value = 1 + DoSomething (ptr - > leftChild) ; if (ptr - > rightChild ! = NULL) value = max (value, 1 + DoSomething (ptr - > rightChild)) ; } return (value); }
The value returned by the function DoSomething when a pointer to the root of a non-empty tree is passed as argument is Options A) The number of leaf nodes in the tree B) The number of nodes in the tree C) The number of internal nodes in the tree D) The height of the tree Your Answer ( Not Answered ) Correct Answer D
|
|
|
|
|
|
|
|
|
|