• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE CS 2010

Question 41

The following program is to be tested for statement coverage:
begin
  if (a== b) {S1; exit;}
  else if (c== d) {S2;]
       else {S3; exit;}
  S4;
end 
The test cases T1, T2, T3 and T4 given below are expressed in terms of the properties satisfied by the values of variables a, b, c and d. The exact values are not given. T1 : a, b, c and d are all equal T2 : a, b, c and d are all distinct T3 : a = b and c != d T4 : a != b and c = d Which of the test suites given below ensures coverage of statements S1, S2, S3 and S4?
  • T1, T2, T3
  • T2, T4
  • T3, T4
  • T1, T2, T4

Question 42

The following program consists of 3 concurrent processes and 3 binary semaphores.The semaphores are initialized as S0 = 1, S1 = 0, S2 = 0. gatecs201042 How many times will process P0 print \'0\'?
  • At least twice
  • Exactly twice
  • Exactly thrice
  • Exactly once

Question 43

Suppose computers A and B have IP addresses 10.105.1.113 and 10.105.1.91 respectively and they both use the same netmask N. Which of the values of N given below should not be used if A and B should belong to the same network?

  • 255.255.255.0

  • 255.255.255.128

  • 255.255.255.192

  • 255.255.255.224

Question 44

A computer system has an L1 cache, an L2 cache, and a main memory unit connected as shown below. The block size in L1 cache is 4 words. The block size in L2 cache is 16 words. The memory access times are 2 nanoseconds. 20 nanoseconds and 200 nanoseconds for L1 cache, L2 cache and main memory unit respectively. CSE_201048 When there is a miss in L1 cache and a hit in L2 cache, a block is transferred from L2 cache to L1 cache. What is the time taken for this transfer?
  • 2 nanoseconds
  • 20 nanoseconds
  • 22 nanoseconds
  • 88 nanoseconds

Question 45

Consider the data from above question. When there is a miss in both L1 cache and L2 cache, first a block is transferred from main memory to L2 cache, and then a block is transferred from L2 cache to L1 cache. What is the total time taken for these transfers?
  • 222 nanoseconds
  • 888 nanoseconds
  • 902 nanoseconds
  • 968 nanoseconds

Question 46

Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Entry Wij in the matrix W below is the weight of the edge {i, j}. 2010 What is the minimum possible weight of a spanning tree T in this graph such that vertex 0 is a leaf node in the tree T?
  • 7
  • 8
  • 9
  • 10

Question 47

In the graph given in above question, what is the minimum possible weight of a path P from vertex 1 to vertex 2 in this graph such that P contains at most 3 edges?
  • 7
  • 8
  • 9
  • 10

Question 48

A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below.

Which one of the following choices gives a possible order in which the key values could have been inserted in the table?
  • 46, 42, 34, 52, 23, 33
  • 34, 42, 23, 52, 33, 46
  • 46, 34, 42, 23, 52, 33
  • 42, 46, 33, 23, 34, 52

Question 49

Consider the data given in above question. How many different insertion sequences of the key values using the same hash function and linear probing will result in the hash table shown above?
  • 10
  • 20
  • 30
  • 40

Question 50

Consider a network with 6 routers R1 to R6 connected with links having weights as shown in the following diagram:

CN_2010_01

All the routers use the distance vector based routing algorithm to update their routing tables. Each router starts with its routing table initialized to contain an entry for each neighbour with the weight of the respective connecting link. After all the routing tables stabilize, how many links in the network will never be used for carrying any data?

  • 4

  • 3

  • 2

  • 1

There are 63 questions to complete.

Last Updated :
Take a part in the ongoing discussion