Page 1 |CS-GATE-2013 PAPER| 1 Q. No. 1 – 25 Carry One Mark Each 1. Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is ½. What is the expected number of unordered cycles of length three? (A) 1/8 (B) 1 (C) 7 (D) 8 Answer:-(C) Exp:- 1 P(edge) 2 = Number of ways we can choose the vertices out of 8 is 3 c 8 (Three edges in each cycle) Expected number of unordered cycles of length 3 = 3 3 C 1 8 7 2 ? ? × = ? ? ? ? 2. Which of the following statements is/are TRUE for undirected graphs? P: Number of odd degree vertices is even. Q: Sum of degrees of all vertices is even. (A) P only (B) Q only (C) Both P and Q (D) Neither P nor Q Answer:- (C) Exp:- Q: Sum of degrees of all vertices ( ) 2 number of edges = × 3. Function f is known at the following points: x 0 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 2.7 3.0 f(x) 0 0.09 0.36 0.81 1.44 2.25 3.24 4.41 5.76 7.29 9.00 The value of ( ) 3 0 f x dx ? computed using the trapezoidal rule is (A) 8.983 (B) 9.003 (C) 9.017 (D) 9.045 Answer:- (D) Exp:- ( ) ( ) ( ) ( ) ( ) ( ) ( ) 3 0 10 1 2 9 0 h f x dx f x f x 2 f x f x ... f x 2 ? ? = + + + + + ? ? ? ( ) 0.3 9.00 2 25.65 9.045 2 = ? + ?= ? ? Page 2 |CS-GATE-2013 PAPER| 1 Q. No. 1 – 25 Carry One Mark Each 1. Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is ½. What is the expected number of unordered cycles of length three? (A) 1/8 (B) 1 (C) 7 (D) 8 Answer:-(C) Exp:- 1 P(edge) 2 = Number of ways we can choose the vertices out of 8 is 3 c 8 (Three edges in each cycle) Expected number of unordered cycles of length 3 = 3 3 C 1 8 7 2 ? ? × = ? ? ? ? 2. Which of the following statements is/are TRUE for undirected graphs? P: Number of odd degree vertices is even. Q: Sum of degrees of all vertices is even. (A) P only (B) Q only (C) Both P and Q (D) Neither P nor Q Answer:- (C) Exp:- Q: Sum of degrees of all vertices ( ) 2 number of edges = × 3. Function f is known at the following points: x 0 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 2.7 3.0 f(x) 0 0.09 0.36 0.81 1.44 2.25 3.24 4.41 5.76 7.29 9.00 The value of ( ) 3 0 f x dx ? computed using the trapezoidal rule is (A) 8.983 (B) 9.003 (C) 9.017 (D) 9.045 Answer:- (D) Exp:- ( ) ( ) ( ) ( ) ( ) ( ) ( ) 3 0 10 1 2 9 0 h f x dx f x f x 2 f x f x ... f x 2 ? ? = + + + + + ? ? ? ( ) 0.3 9.00 2 25.65 9.045 2 = ? + ?= ? ? |CS-GATE-2013 PAPER| 2 4. Which one of the following functions is continuous at x = 3 ? ( ) ( ) 2, if x 3 A f x x 1, if x 3 x 3 , if x 3 3 ? ? = ? = - > ? ? + ? < ? ( ) ( ) 4, if x 3 B f x 8 x if x 3 = ? = ? - ? ? ( ) ( ) x 3, if x 3 C f x x 4 if x 3 + = ? = ? - > ? ( ) ( ) 3 1 D f x , if x 3 x 27 = ? - Answer:-(A) Exp:- ( ) ( ) ( ) x 3 x 3 lim f x lim x 1 2 f 3 ? + ? + = - = = ( ) ( ) ( ) x 3 x 3 x 3 lim f x lim 2 f 3 3 f x is continuous at x 3 ? - ? - + ? ? = = = ? ? ? ? ? = 5. Which one of the following expressions does NOT represent exclusive NOR of x and y? (A) xy x 'y' + (B) x y' ? (C) x ' y ? (D) x ' y' ? Answer: -(D) Exp:- (A) x y xy x y = + ( ) B x y xy x y xy x y x y ? = + = + = ( ) ( ) C x y x y x y x y xy x y ? = + = + = ( ) ( ) D x y x y x y x y ? = + = ? 6. In a k-way set associative cache, the cache is divided into v sets, each of which consists of k lines. The lines of a set are placed in sequence one after another. The lines in set s are sequenced before the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main memory block numbered j must be mapped to any one of the cache lines from (A) ( ) ( ) ( ) j mod v *k to j mod v *k k 1 + - (B) ( ) ( ) ( ) j mod v to j mod v k 1 + - (C) ( ) ( ) ( ) j mod k to j mod k v 1 + - (D) ( ) ( ) ( ) j mod k * v to j mod k * v v 1 + - Answer: -(A) Exp:- Position of main memory block in the cache (set) = (main memory block number) MOD (number of sets in the cache). As the lines in the set are placed in sequence, we can have the lines from 0 to (K – 1) in each set. Number of sets = v, main memory block number = j First line of cache = (j mod v)*k; last line of cache = (j mod v)*k + (k – 1) Page 3 |CS-GATE-2013 PAPER| 1 Q. No. 1 – 25 Carry One Mark Each 1. Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is ½. What is the expected number of unordered cycles of length three? (A) 1/8 (B) 1 (C) 7 (D) 8 Answer:-(C) Exp:- 1 P(edge) 2 = Number of ways we can choose the vertices out of 8 is 3 c 8 (Three edges in each cycle) Expected number of unordered cycles of length 3 = 3 3 C 1 8 7 2 ? ? × = ? ? ? ? 2. Which of the following statements is/are TRUE for undirected graphs? P: Number of odd degree vertices is even. Q: Sum of degrees of all vertices is even. (A) P only (B) Q only (C) Both P and Q (D) Neither P nor Q Answer:- (C) Exp:- Q: Sum of degrees of all vertices ( ) 2 number of edges = × 3. Function f is known at the following points: x 0 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 2.7 3.0 f(x) 0 0.09 0.36 0.81 1.44 2.25 3.24 4.41 5.76 7.29 9.00 The value of ( ) 3 0 f x dx ? computed using the trapezoidal rule is (A) 8.983 (B) 9.003 (C) 9.017 (D) 9.045 Answer:- (D) Exp:- ( ) ( ) ( ) ( ) ( ) ( ) ( ) 3 0 10 1 2 9 0 h f x dx f x f x 2 f x f x ... f x 2 ? ? = + + + + + ? ? ? ( ) 0.3 9.00 2 25.65 9.045 2 = ? + ?= ? ? |CS-GATE-2013 PAPER| 2 4. Which one of the following functions is continuous at x = 3 ? ( ) ( ) 2, if x 3 A f x x 1, if x 3 x 3 , if x 3 3 ? ? = ? = - > ? ? + ? < ? ( ) ( ) 4, if x 3 B f x 8 x if x 3 = ? = ? - ? ? ( ) ( ) x 3, if x 3 C f x x 4 if x 3 + = ? = ? - > ? ( ) ( ) 3 1 D f x , if x 3 x 27 = ? - Answer:-(A) Exp:- ( ) ( ) ( ) x 3 x 3 lim f x lim x 1 2 f 3 ? + ? + = - = = ( ) ( ) ( ) x 3 x 3 x 3 lim f x lim 2 f 3 3 f x is continuous at x 3 ? - ? - + ? ? = = = ? ? ? ? ? = 5. Which one of the following expressions does NOT represent exclusive NOR of x and y? (A) xy x 'y' + (B) x y' ? (C) x ' y ? (D) x ' y' ? Answer: -(D) Exp:- (A) x y xy x y = + ( ) B x y xy x y xy x y x y ? = + = + = ( ) ( ) C x y x y x y x y xy x y ? = + = + = ( ) ( ) D x y x y x y x y ? = + = ? 6. In a k-way set associative cache, the cache is divided into v sets, each of which consists of k lines. The lines of a set are placed in sequence one after another. The lines in set s are sequenced before the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main memory block numbered j must be mapped to any one of the cache lines from (A) ( ) ( ) ( ) j mod v *k to j mod v *k k 1 + - (B) ( ) ( ) ( ) j mod v to j mod v k 1 + - (C) ( ) ( ) ( ) j mod k to j mod k v 1 + - (D) ( ) ( ) ( ) j mod k * v to j mod k * v v 1 + - Answer: -(A) Exp:- Position of main memory block in the cache (set) = (main memory block number) MOD (number of sets in the cache). As the lines in the set are placed in sequence, we can have the lines from 0 to (K – 1) in each set. Number of sets = v, main memory block number = j First line of cache = (j mod v)*k; last line of cache = (j mod v)*k + (k – 1) |CS-GATE-2013 PAPER| 3 7. What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of n vertices? (A) ( ) 2 n T (B) ( ) 2 n log n T (C) ( ) 3 n T (D) ( ) 3 n log n T Answer:-(C) Exp:- Bellman-ford time complexity: ( V E ) T × For complete graph: n(n 1) E 2 - = 3 V n n(n 1) n (n ) 2 = - ? ? ?T × =T ? ? ? ? 8. Which of the following statements are TRUE? (1) The problem of determining whether there exists a cycle in an undirected graph is in P. (2) The problem of determining whether there exists a cycle in an undirected graph is in NP. (3) If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A. (A) 1,2 and 3 (B) 1 and 2 only (C) 2 and 3 only (D) 1 and 3 only Answer: -(A) Exp:- 1. Cycle detection using DFS: 2 O(V E) O(V ) + = and it is polynomial problem 2. Every P-problem is NP( ) since P NP ? 3. NP complete NP - ? Hence, NP-complete can be solved in non-deterministic polynomial time 9. Which of the following statements is/are FALSE? (1) For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine. (2) Turing recognizable languages are closed under union and complementation. (3) Turing decidable languages are closed under intersection and complementation (4) Turing recognizable languages are closed under union and intersection. (A) 1 and 4 only (B) 1 and 3 only (C) 2 only (D) 3 only Answer: -(C) Exp:- (1) NTM ? DTM (2) RELs are closed under union & but not complementation (3) Turing decidable languages are recursive and recursive languages are closed under intersection and complementation (4) RELs are closed under union & intersection but not under complementation Page 4 |CS-GATE-2013 PAPER| 1 Q. No. 1 – 25 Carry One Mark Each 1. Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is ½. What is the expected number of unordered cycles of length three? (A) 1/8 (B) 1 (C) 7 (D) 8 Answer:-(C) Exp:- 1 P(edge) 2 = Number of ways we can choose the vertices out of 8 is 3 c 8 (Three edges in each cycle) Expected number of unordered cycles of length 3 = 3 3 C 1 8 7 2 ? ? × = ? ? ? ? 2. Which of the following statements is/are TRUE for undirected graphs? P: Number of odd degree vertices is even. Q: Sum of degrees of all vertices is even. (A) P only (B) Q only (C) Both P and Q (D) Neither P nor Q Answer:- (C) Exp:- Q: Sum of degrees of all vertices ( ) 2 number of edges = × 3. Function f is known at the following points: x 0 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 2.7 3.0 f(x) 0 0.09 0.36 0.81 1.44 2.25 3.24 4.41 5.76 7.29 9.00 The value of ( ) 3 0 f x dx ? computed using the trapezoidal rule is (A) 8.983 (B) 9.003 (C) 9.017 (D) 9.045 Answer:- (D) Exp:- ( ) ( ) ( ) ( ) ( ) ( ) ( ) 3 0 10 1 2 9 0 h f x dx f x f x 2 f x f x ... f x 2 ? ? = + + + + + ? ? ? ( ) 0.3 9.00 2 25.65 9.045 2 = ? + ?= ? ? |CS-GATE-2013 PAPER| 2 4. Which one of the following functions is continuous at x = 3 ? ( ) ( ) 2, if x 3 A f x x 1, if x 3 x 3 , if x 3 3 ? ? = ? = - > ? ? + ? < ? ( ) ( ) 4, if x 3 B f x 8 x if x 3 = ? = ? - ? ? ( ) ( ) x 3, if x 3 C f x x 4 if x 3 + = ? = ? - > ? ( ) ( ) 3 1 D f x , if x 3 x 27 = ? - Answer:-(A) Exp:- ( ) ( ) ( ) x 3 x 3 lim f x lim x 1 2 f 3 ? + ? + = - = = ( ) ( ) ( ) x 3 x 3 x 3 lim f x lim 2 f 3 3 f x is continuous at x 3 ? - ? - + ? ? = = = ? ? ? ? ? = 5. Which one of the following expressions does NOT represent exclusive NOR of x and y? (A) xy x 'y' + (B) x y' ? (C) x ' y ? (D) x ' y' ? Answer: -(D) Exp:- (A) x y xy x y = + ( ) B x y xy x y xy x y x y ? = + = + = ( ) ( ) C x y x y x y x y xy x y ? = + = + = ( ) ( ) D x y x y x y x y ? = + = ? 6. In a k-way set associative cache, the cache is divided into v sets, each of which consists of k lines. The lines of a set are placed in sequence one after another. The lines in set s are sequenced before the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main memory block numbered j must be mapped to any one of the cache lines from (A) ( ) ( ) ( ) j mod v *k to j mod v *k k 1 + - (B) ( ) ( ) ( ) j mod v to j mod v k 1 + - (C) ( ) ( ) ( ) j mod k to j mod k v 1 + - (D) ( ) ( ) ( ) j mod k * v to j mod k * v v 1 + - Answer: -(A) Exp:- Position of main memory block in the cache (set) = (main memory block number) MOD (number of sets in the cache). As the lines in the set are placed in sequence, we can have the lines from 0 to (K – 1) in each set. Number of sets = v, main memory block number = j First line of cache = (j mod v)*k; last line of cache = (j mod v)*k + (k – 1) |CS-GATE-2013 PAPER| 3 7. What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of n vertices? (A) ( ) 2 n T (B) ( ) 2 n log n T (C) ( ) 3 n T (D) ( ) 3 n log n T Answer:-(C) Exp:- Bellman-ford time complexity: ( V E ) T × For complete graph: n(n 1) E 2 - = 3 V n n(n 1) n (n ) 2 = - ? ? ?T × =T ? ? ? ? 8. Which of the following statements are TRUE? (1) The problem of determining whether there exists a cycle in an undirected graph is in P. (2) The problem of determining whether there exists a cycle in an undirected graph is in NP. (3) If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A. (A) 1,2 and 3 (B) 1 and 2 only (C) 2 and 3 only (D) 1 and 3 only Answer: -(A) Exp:- 1. Cycle detection using DFS: 2 O(V E) O(V ) + = and it is polynomial problem 2. Every P-problem is NP( ) since P NP ? 3. NP complete NP - ? Hence, NP-complete can be solved in non-deterministic polynomial time 9. Which of the following statements is/are FALSE? (1) For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine. (2) Turing recognizable languages are closed under union and complementation. (3) Turing decidable languages are closed under intersection and complementation (4) Turing recognizable languages are closed under union and intersection. (A) 1 and 4 only (B) 1 and 3 only (C) 2 only (D) 3 only Answer: -(C) Exp:- (1) NTM ? DTM (2) RELs are closed under union & but not complementation (3) Turing decidable languages are recursive and recursive languages are closed under intersection and complementation (4) RELs are closed under union & intersection but not under complementation |CS-GATE-2013 PAPER| 4 10. Three concurrent processes X, Y, and Z execute three different code segments that access and update certain shared variables. Process X executes the P operation (i.e., wait) on semaphores a, b and c; process Y executes the P operation on semaphores b, c and d; process Z executes the P operation on semaphores c, d, and a before entering the respective code segments. After completing the execution of its code segment, each process invokes the V operation (i.e., signal) on its three semaphores. All semaphores are binary semaphores initialized to one. Which one of the following represents a deadlock-free order of invoking the P operations by the processes? (A) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) X : P a P b P c Y : P b P c P d Z: P c P d P a (B) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) X : P b P a P c Y : P b P c P d Z: P a P c P d (C) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) X : P b P a P c Y : P c P b P d Z: P a P c P d (D) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) X : P a P b P c Y : P c P b P d Z: P c P d P a Answer:-(B) Exp:- Suppose X performs P(b) and preempts, Y gets chance, but cannot do its first wait i.e., P(b), so waits for X, now Z gets the chance and performs P(a) and preempts, next X gets chance. X cannot continue as wait on ‘a’ is done by Z already, so X waits for Z. At this time Z can continue its operations as down on c and d. Once Z finishes, X can do its operations and so Y. In any of execution order of X, Y, Z one process can continue and finish, such that waiting is not circular. In options (A),(C) and (D) we can easily find circular wait, thus deadlock 11. An index is clustered, if (A) it is on a set of fields that form a candidate key (B) it is on a set of fields that include the primary key (C) the data records of the file are organized in the same order as the data entries of the index (D) the data records of the file are organized not in the same order as the data entries of the index Answer:-(C) Exp:- Clustered index is built on ordering non key field and hence if the index is clustered then the data records of the file are organized in the same order as the data entries of the index. 12. Assume that source S and destination D are connected through two intermediate routers labeled R. Determine how many times each packet has to visit the network layer and the data link layer during a transmission from S to D. (A) Network layer – 4 times and Data link layer-4 times (B) Network layer – 4 times and Data link layer-3 times (C) Network layer – 4 times and Data link layer-6 times (D) Network layer – 2 times and Data link layer-6 times S R R D Page 5 |CS-GATE-2013 PAPER| 1 Q. No. 1 – 25 Carry One Mark Each 1. Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is ½. What is the expected number of unordered cycles of length three? (A) 1/8 (B) 1 (C) 7 (D) 8 Answer:-(C) Exp:- 1 P(edge) 2 = Number of ways we can choose the vertices out of 8 is 3 c 8 (Three edges in each cycle) Expected number of unordered cycles of length 3 = 3 3 C 1 8 7 2 ? ? × = ? ? ? ? 2. Which of the following statements is/are TRUE for undirected graphs? P: Number of odd degree vertices is even. Q: Sum of degrees of all vertices is even. (A) P only (B) Q only (C) Both P and Q (D) Neither P nor Q Answer:- (C) Exp:- Q: Sum of degrees of all vertices ( ) 2 number of edges = × 3. Function f is known at the following points: x 0 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 2.7 3.0 f(x) 0 0.09 0.36 0.81 1.44 2.25 3.24 4.41 5.76 7.29 9.00 The value of ( ) 3 0 f x dx ? computed using the trapezoidal rule is (A) 8.983 (B) 9.003 (C) 9.017 (D) 9.045 Answer:- (D) Exp:- ( ) ( ) ( ) ( ) ( ) ( ) ( ) 3 0 10 1 2 9 0 h f x dx f x f x 2 f x f x ... f x 2 ? ? = + + + + + ? ? ? ( ) 0.3 9.00 2 25.65 9.045 2 = ? + ?= ? ? |CS-GATE-2013 PAPER| 2 4. Which one of the following functions is continuous at x = 3 ? ( ) ( ) 2, if x 3 A f x x 1, if x 3 x 3 , if x 3 3 ? ? = ? = - > ? ? + ? < ? ( ) ( ) 4, if x 3 B f x 8 x if x 3 = ? = ? - ? ? ( ) ( ) x 3, if x 3 C f x x 4 if x 3 + = ? = ? - > ? ( ) ( ) 3 1 D f x , if x 3 x 27 = ? - Answer:-(A) Exp:- ( ) ( ) ( ) x 3 x 3 lim f x lim x 1 2 f 3 ? + ? + = - = = ( ) ( ) ( ) x 3 x 3 x 3 lim f x lim 2 f 3 3 f x is continuous at x 3 ? - ? - + ? ? = = = ? ? ? ? ? = 5. Which one of the following expressions does NOT represent exclusive NOR of x and y? (A) xy x 'y' + (B) x y' ? (C) x ' y ? (D) x ' y' ? Answer: -(D) Exp:- (A) x y xy x y = + ( ) B x y xy x y xy x y x y ? = + = + = ( ) ( ) C x y x y x y x y xy x y ? = + = + = ( ) ( ) D x y x y x y x y ? = + = ? 6. In a k-way set associative cache, the cache is divided into v sets, each of which consists of k lines. The lines of a set are placed in sequence one after another. The lines in set s are sequenced before the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main memory block numbered j must be mapped to any one of the cache lines from (A) ( ) ( ) ( ) j mod v *k to j mod v *k k 1 + - (B) ( ) ( ) ( ) j mod v to j mod v k 1 + - (C) ( ) ( ) ( ) j mod k to j mod k v 1 + - (D) ( ) ( ) ( ) j mod k * v to j mod k * v v 1 + - Answer: -(A) Exp:- Position of main memory block in the cache (set) = (main memory block number) MOD (number of sets in the cache). As the lines in the set are placed in sequence, we can have the lines from 0 to (K – 1) in each set. Number of sets = v, main memory block number = j First line of cache = (j mod v)*k; last line of cache = (j mod v)*k + (k – 1) |CS-GATE-2013 PAPER| 3 7. What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of n vertices? (A) ( ) 2 n T (B) ( ) 2 n log n T (C) ( ) 3 n T (D) ( ) 3 n log n T Answer:-(C) Exp:- Bellman-ford time complexity: ( V E ) T × For complete graph: n(n 1) E 2 - = 3 V n n(n 1) n (n ) 2 = - ? ? ?T × =T ? ? ? ? 8. Which of the following statements are TRUE? (1) The problem of determining whether there exists a cycle in an undirected graph is in P. (2) The problem of determining whether there exists a cycle in an undirected graph is in NP. (3) If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A. (A) 1,2 and 3 (B) 1 and 2 only (C) 2 and 3 only (D) 1 and 3 only Answer: -(A) Exp:- 1. Cycle detection using DFS: 2 O(V E) O(V ) + = and it is polynomial problem 2. Every P-problem is NP( ) since P NP ? 3. NP complete NP - ? Hence, NP-complete can be solved in non-deterministic polynomial time 9. Which of the following statements is/are FALSE? (1) For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine. (2) Turing recognizable languages are closed under union and complementation. (3) Turing decidable languages are closed under intersection and complementation (4) Turing recognizable languages are closed under union and intersection. (A) 1 and 4 only (B) 1 and 3 only (C) 2 only (D) 3 only Answer: -(C) Exp:- (1) NTM ? DTM (2) RELs are closed under union & but not complementation (3) Turing decidable languages are recursive and recursive languages are closed under intersection and complementation (4) RELs are closed under union & intersection but not under complementation |CS-GATE-2013 PAPER| 4 10. Three concurrent processes X, Y, and Z execute three different code segments that access and update certain shared variables. Process X executes the P operation (i.e., wait) on semaphores a, b and c; process Y executes the P operation on semaphores b, c and d; process Z executes the P operation on semaphores c, d, and a before entering the respective code segments. After completing the execution of its code segment, each process invokes the V operation (i.e., signal) on its three semaphores. All semaphores are binary semaphores initialized to one. Which one of the following represents a deadlock-free order of invoking the P operations by the processes? (A) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) X : P a P b P c Y : P b P c P d Z: P c P d P a (B) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) X : P b P a P c Y : P b P c P d Z: P a P c P d (C) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) X : P b P a P c Y : P c P b P d Z: P a P c P d (D) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) X : P a P b P c Y : P c P b P d Z: P c P d P a Answer:-(B) Exp:- Suppose X performs P(b) and preempts, Y gets chance, but cannot do its first wait i.e., P(b), so waits for X, now Z gets the chance and performs P(a) and preempts, next X gets chance. X cannot continue as wait on ‘a’ is done by Z already, so X waits for Z. At this time Z can continue its operations as down on c and d. Once Z finishes, X can do its operations and so Y. In any of execution order of X, Y, Z one process can continue and finish, such that waiting is not circular. In options (A),(C) and (D) we can easily find circular wait, thus deadlock 11. An index is clustered, if (A) it is on a set of fields that form a candidate key (B) it is on a set of fields that include the primary key (C) the data records of the file are organized in the same order as the data entries of the index (D) the data records of the file are organized not in the same order as the data entries of the index Answer:-(C) Exp:- Clustered index is built on ordering non key field and hence if the index is clustered then the data records of the file are organized in the same order as the data entries of the index. 12. Assume that source S and destination D are connected through two intermediate routers labeled R. Determine how many times each packet has to visit the network layer and the data link layer during a transmission from S to D. (A) Network layer – 4 times and Data link layer-4 times (B) Network layer – 4 times and Data link layer-3 times (C) Network layer – 4 times and Data link layer-6 times (D) Network layer – 2 times and Data link layer-6 times S R R D |CS-GATE-2013 PAPER| 5 Answer:-(C) Exp:- From above given diagram, its early visible that packet will visit network layer 4 times, once at each node [S, R, R, D] and packet will visit Data Link layer 6 times. One time at S and one time at D, then two times for each intermediate router R as data link layer is used for link to link communication. Once at packet reaches R and goes up from physical –DL-Network and second time when packet coming out of router in order Network – DL- Physical 13. The transport layer protocols used for real time multimedia, file transfer, DNS and email, respectively are (A) TCP, UDP, UDP and TCP (B) UDP, TCP, TCP and UDP (C) UDP, TCP, UDP and TCP (D) TCP, UDP, TCP and UDP Answer:- (C) Exp:- Real time multimedia needs connectionless service, so under lying transport layer protocol used is UDP File transfer rums over TCP protocol with port no-21 DNS runs over UDP protocol within port no-53 Email needs SMTP protocol which runs over TCP protocol within port no – 25 14. Using public key cryptography, X adds a digital signature s to message M, encrypts <M, s >, and sends it to Y, where it is decrypted. Which one of the following sequences of keys is used for the operations? (A) Encryption: X’s private key followed by Y’s private key; Decryption: X’s public key followed by Y’s public key (B) Encryption: X’s private key followed by Y’s public key; Decryption: X’s public key followed by Y’s private key (C) Encryption: X’s public key followed by Y’s private key; Decryption: Y’s public key followed by X’s private key (D) Encryption: X’s private key followed by Y’s public key; Decryption: Y’s private key followed by X’s public key Application Transport Network Datalink Physical Network DataLink Physical Network DataLink Physical Application Transport Network Datalink Physical ( ) Source S R R ( ) Destination DRead More

Offer running on EduRev: __Apply code STAYHOME200__ to get INR 200 off on our premium plan EduRev Infinity!

380 docs|127 tests

- Computer Science and Information Technology (CS) 2013 GATE Paper (Set A) without solution
- Computer Science and Information Technology (CS) 2012 GATE Paper (Set D) with solution
- Computer Science and Information Technology (CS) 2012 GATE Paper (Set A) with solution
- Computer Science and Information Technology (CS) 2011 GATE Paper without solution
- Computer Science and Information Technology (CS) 2010 GATE Paper without solution
- Computer Science and Information Technology (CS) 2009 GATE Paper without solution