Javatpoint Logo
Javatpoint Logo

GATE 2018 CS Set 3

17) Consider a matrix A = uvT where u = =, v =GATE CS Set 3. Note that vT denotes the transpose of v. The largest eigen value of A is ________ .

  1. 1
  2. 2
  3. 3
  4. 4

Answer: C

Explanation:

GATE CS Set 3vT = [1 1]

A = uvT     = 2 [1 1]

GATE CS Set 3


18) The chromatic number of the following graph is _________ .

GATE CS Set 3


  1. 2
  2. 4
  3. 3
  4. 5

Answer: C

Explanation:

The chromatic number of a graph is the minimum number of colors needed to produce a proper coloring of a graph and no two vertex which share same edge have the same color.

GATE CS Set 3

Hence, the chromatic number of a given graph is 3.


19) Let G be a finite group on 84 elements. The size of a largest possible proper subgroup of G is _______ .

  1. 42
  2. 44
  3. 21
  4. 28

Answer: A

Explanation:

We know that the Order of a Subgroup is always divided the order of Group.

Therefore Proper Subgroup of Group having Divisors of the Positive Integer 84 is:

       1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42

So largest order would be 42.


20) The postorder traversal of a binary tree is 8, 9, 6, 7, 4, 5, 2, 3, 1. The inorder traversal of the same tree is 8, 6, 9, 4, 7, 2, 5, 1, 3. The height of a tree is the length of the longest path from the root to any leaf. The height of the binary tree above is ________ .

  1. 2
  2. 3
  3. 4
  4. 6

Answer: C

Explanation:

GATE CS Set 3

Given,
post-order of a binary tree -> 8, 9, 6, 7, 4, 5, 2, 3, 1

in-order of a binary tree -> 8, 6, 9, 4, 7, 2, 5, 1, 3

Therefore,

Nodes in longest path from Root to Leaf =
       (1-2, 2-4, 4-6, 6-8) or (1-2, 2-4, 4-6, 6-9)

Hence, The height of the binary tree above is 4.


21) Consider the following C program:

The output of this program is ________ .

  1. 5
  2. 4
  3. 3
  4. None of these

Answer: B

Explanation:

According to the question,

       Since it is given - printf("%d", counter);
       So, we need to print only counter value.

In the given program, whenever function called, it increments counter value by 1. So we need to find that how many times the function calls happened.

The squence of function calls:
calc(4, 81) ---> calc(4, 27) ---> calc(4, 9) ---> calc(4, 3) ---> return
Four function calls.

Therefore, the correct answer is the option (B).


22) Consider the sequential circuit shown in the figure, where both flip-flops used are positive edge-triggered D flip-flops.

GATE CS Set 3

The number of states in the state transition diagram of this circuit that have a transition back to the same state on some value of "in" is _____.

  1. 2
  2. 4
  3. 6
  4. None of these

Answer: A

Explanation:

The State-Table of the above Sequential Circuit is:

Present State Input Flip Flop Inputs Next State
Q0 Q1 X D1=x D0=Q1 Q1 Q0 Output(Q0)
0 0 0 0 0 0 0 0
0 0 1 1 0 1 0 0
0 1 0 0 0 0 0 0
0 1 1 1 0 1 0 0
1 0 0 0 1 0 1 1
1 0 1 1 1 1 1 1
1 1 0 0 1 0 1 1
1 1 1 1 1 1 1 1

GATE CS Set 3

In the above diagram 00 on input 0 and 11 on input 1 have transition back to the same state means self loop. Since, there are only two self loop states are available. Hence, Option (A) is the correct answer.


23) A 32 - bit wide main memory unit with a capacity of 1 GB is built using 256M X 4-bit DRAM chips. The number of rows of memory cells in the DRAM chip is 214. The time taken to perform one refresh operation is 50 nanoseconds. The refresh period is 2 milliseconds. The percentage (rounded to the closet integer) of the time available for performing the memory read/write operations in the main memory unit is _______ .

  1. 59 %
  2. 60 %
  3. 99 %
  4. None of these

Answer: A

Explanation:

Given,
   Total number of rows = 214
   One refresh operation = 50ns.
   The Refresh Period = 2ms.

Now,

Total time to refresh all Rows = number of rows * refresh operation
                                = 214 * 50ns
                                = 819200ns
                                = 0.819200ms

% Time spent in refresh = Total time to Refresh all Rows / Refresh period * 100
                                = 0.8192ms / 2.0ms * 100
                                = 40.96%

Hence, % Time spent in Read/Write = 100 - 40.96
                                = 59.04% <=> 59%


24) Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of K instances. Resource instances can be requested and released only one at a time. The largest value of K that will always avoid deadlock is ____.

  1. 0
  2. 1
  3. 2
  4. 3

Answer: C

Explanation:

Given,
Since deadlock-free condition is:
R ≥ P(K - 1) + 1 or P(K - 1) + 1 ≤ R
Where, R -> total number of resources,
P -> t
The number of processes, and
K -> The maximum need for each resource.

Therefore,

       3(K - 1) + 1 ≤ 4
       3K - 2 ≤ 4
       3K ≤ 6
       K ≤ 2

Hence, the largest value of K that will always avoid deadlock is 2.


GATE 2018 CS Set 3-1
GATE 2018 CS Set 3-2
GATE 2018 CS Set 3-4
GATE 2018 CS Set 3-5
GATE 2018 CS Set 3-6
GATE 2018 CS Set 3-7
GATE 2018 CS Set 3-8
GATE Introduction





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA