Gate (CS) 2013 Paper with Solution (Set B)

# Gate (CS) 2013 Paper with Solution (Set B) - GATE Computer Science Engineering(CSE) 2024 Mock Test Series - Computer Science Engineering (CSE)

``` 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
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
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
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
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
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
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
= ?
-

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' ?
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 + -
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
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
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
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
= ?
-

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' ?
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 + -
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
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
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
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
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
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
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
= ?
-

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' ?
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 + -
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
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
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
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
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
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
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
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
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
= ?
-

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' ?
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 + -
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
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
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
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
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
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
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
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
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
Physical
Network
Physical
Network
Physical
Application
Transport
Network
Physical
( )
Source
S R R
( )
Destination
D
```

## GATE Computer Science Engineering(CSE) 2024 Mock Test Series

151 docs|216 tests

## FAQs on Gate (CS) 2013 Paper with Solution (Set B) - GATE Computer Science Engineering(CSE) 2024 Mock Test Series - Computer Science Engineering (CSE)

 1. How can I access the Gate (CS) 2013 Paper with Solution (Set B)? Ans. You can access the Gate (CS) 2013 Paper with Solution (Set B) by searching for it on various educational websites and forums. Many websites provide previous year question papers and their solutions for free or at a nominal cost. Additionally, you can also check if the official Gate website has made the paper and solution available for download.
 2. Is the Gate (CS) 2013 Paper with Solution (Set B) relevant for the current Gate exam? Ans. Yes, the Gate (CS) 2013 Paper with Solution (Set B) can be helpful for the current Gate exam preparation. Although the question patterns and syllabus may have changed over the years, solving previous year papers can give you an idea of the exam pattern, question types, and difficulty level. It is always recommended to practice with a variety of question papers, including previous years, to enhance your preparation.
 3. Are the solutions provided in the Gate (CS) 2013 Paper with Solution (Set B) accurate and reliable? Ans. The solutions provided in the Gate (CS) 2013 Paper with Solution (Set B) are generally accurate and reliable. However, it is always advisable to cross-verify the solutions with other trusted sources or consult subject matter experts if you have any doubts or discrepancies. Sometimes, there can be multiple correct approaches or interpretations for a particular question, so it's crucial to understand the concepts thoroughly.
 4. Can I solely rely on the Gate (CS) 2013 Paper with Solution (Set B) for my exam preparation? Ans. While the Gate (CS) 2013 Paper with Solution (Set B) can be a valuable resource for your exam preparation, it is not recommended to solely rely on it. It is crucial to have a comprehensive study plan, which includes understanding the exam syllabus, referring to standard textbooks, taking mock tests, and solving a variety of practice questions. Utilize the previous year papers as an additional tool to gauge your preparation level and identify areas of improvement.
 5. How can solving the Gate (CS) 2013 Paper with Solution (Set B) benefit my exam preparation? Ans. Solving the Gate (CS) 2013 Paper with Solution (Set B) can benefit your exam preparation in several ways. It helps you understand the exam pattern, time management, and the types of questions asked. Additionally, it allows you to practice applying theoretical knowledge to practical problems, enhances your problem-solving skills, and identifies your strengths and weaknesses. Regular practice with previous year papers can boost your confidence and improve your overall performance in the Gate exam.

## GATE Computer Science Engineering(CSE) 2024 Mock Test Series

151 docs|216 tests Explore Courses for Computer Science Engineering (CSE) exam Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Track your progress, build streaks, highlight & save important lessons and more!
Related Searches

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

;