• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Gate IT 2005

Question 81

Q84 Part_A
A sink in a directed graph is a vertex i such that there is an edge from every vertex j ≠ i to i and there is no edge from i to any other vertex. A directed graph G with n vertices is represented by its adjacency matrix A, where A[i] [j] = 1 if there is an edge directed from vertex i to j and 0 otherwise. The following algorithm determines whether there is a sink in the graph G.
i = 0
do {
    j = i + 1;
    while ((j < n) && E1) 
       j++;
    if (j < n) E2;
} while (j < n);

flag = 1;
for (j = 0; j < n; j++)
    if ((j! = i) && E3)
        flag = 0;

if (flag)
    printf("Sink exists");
else
    printf ("Sink does not exist");
Choose the correct expressions for E1 and E2  
  • E1 : A[i][j] and E2 : i = j;
  • E1 : !A[i][j] and E2 : i = j + 1;
  • E1: !A[i][j] and E2 : i = j;
  • E1 : A[i][j] and E2 : i = j + 1;

Question 82

Q84 Part_B
A sink in a directed graph is a vertex i such that there is an edge from every vertex j ≠ i to i and there is no edge from i to any other vertex. A directed graph G with n vertices is represented by its adjacency matrix A, where A[i] [j] = 1 if there is an edge directed from vertex i to j and 0 otherwise. The following algorithm determines whether there is a sink in the graph G.
i = 0
do {
    j = i + 1;
    while ((j < n) && E1) j++;
    if (j < n) E2;
} while (j < n);

flag = 1;
for (j = 0; j < n; j++)
    if ((j! = i) && E3)
        flag = 0;

if (flag)
    printf("Sink exists");
else
    printf("Sink does not exist");

Choose the correct expressions for E3  
  • (A[i][j] && !A[j][i])
  • (!A[i][j] && A[j][i])
  • (!A[i][j] | |  A[j][i])
  • (A[i][j] | | !A[j][i])

Question 83

Q85  Part_A Consider a simple graph with unit edge costs. Each node in the graph represents a router. Each node maintains a routing table indicating the next hop router to be used to relay a packet to its destination and the cost of the path to the destination through that router. Initially, the routing table is empty. The routing table is synchronously updated as follows. In each updation interval, three tasks are performed.
  1. A node determines whether its neighbours in the graph are accessible. If so, it sets the tentative cost to each accessible neighbour as 1. Otherwise, the cost is set to ∞.
  2. From each accessible neighbour, it gets the costs to relay to other nodes via that neighbour (as the next hop).
  3. Each node updates its routing table based on the information received in the previous two steps by choosing the minimum cost.
download
For the graph given above, possible routing tables for various nodes after they have stabilized, are shown in the following options. Identify the correct table.
1) Table for node A
 A  -  -
 B  B  1
 C  C  1
 D  B  3
 E  C  3
 F  C  4
2) Table for node C
 A  A  1
 B  B  1
 C  -  -
 D  D  1
 E  E  1
 F  E  3
3)
Table for node B
 A  A  1
 B  -  -
 C  C  1
 D  D  1
 E  C  2
 F  D  2
4) Table for node D
 A  B  3
 B  B  1
 C  C  1
 D  - -
 E  E  1
 F  F  1
  • A
  • B
  • C
  • D

Question 84

Q85 Part_B Consider a simple graph with unit edge costs. Each node in the graph represents a router. Each node maintains a routing table indicating the next hop router to be used to relay a packet to its destination and the cost of the path to the destination through that router. Initially, the routing table is empty. The routing table is synchronously updated as follows. In each updation interval, three tasks are performed.
  1. A node determines whether its neighbours in the graph are accessible. If so, it sets the tentative cost to each accessible neighbour as 1. Otherwise, the cost is set to ∞.
  2. From each accessible neighbour, it gets the costs to relay to other nodes via that neighbour (as the next hop).
  3. Each node updates its routing table based on the information received in the previous two steps by choosing the minimum cost.
download
For the graph given above, possible routing tables for various nodes after they have stabilized, are shown in the following options. Identify the correct table.
1) Table for node A
 A  -  -
 B  B  1
 C  C  1
 D  B  3
 E  C  3
 F  C  4
2) Table for node C
 A  A  1
 B  B  1
 C  -  -
 D  D  1
 E  E  1
 F  E  3
3)
Table for node B
 A  A  1
 B  -  -
 C  C  1
 D  D  1
 E  C  2
 F  D  2
4) Table for node D
 A  B  3
 B  B  1
 C  C  1
 D  - -
 E  E  1
 F  F  1
Continuing from the earlier problem, suppose at some time t, when the costs have stabilized, node A goes down. The cost from node F to node A at time (t + 100) is  
  • >100 but finite
  • 3
  • >3 and ≤100

Question 85

Let G be a weighted undirected graph and e be an edge with maximum weight in G. Suppose there is a minimum weight spanning tree in G containing the edge e. Which of the following statements is always TRUE?  
  • There exists a cutset in G having all edges of maximum weight.
  • There exists a cycle in G having all edges of maximum weight
  • Edge e cannot be contained in a cycle.
  • All edges in G have the same weight

Question 86

Two shared resources R1 and R2 are used by processes P1 and P2. Each process has a certain priority for accessing each resource. Let Tij denote the priority of Pi for accessing  Rj. A process Pi can snatch a resource Rh from process Pj if Tik is greater than Tjk. Given the following :
  1. T11 > T21
  2. T12 > T22
  3. T11 < T21
  4. T12 < T22
Which of the following conditions ensures that P1 and P2 can never deadlock?  
  • (I) and (IV)
  • (II) and (III)
  • (I) and (II)
  • None of the above

Question 87

The shell command
find -name passwd -print
is executed in /etc directory of a computer system running Unix. Which of the following shell commands will give the same information as the above command when executed in the same directory?  
  • ls passwd
  • cat passwd
  • grep name passwd
  • grep print passwd

Question 88

A student wishes to create symbolic links in a computer system running Unix. Three text files named "file 1", "file 2" and "file 3" exist in her current working directory, and the student has read and write permissions for all three files. Assume that file 1 contains information about her hobbies, file 2 contains information about her friends and file 3 contains information about her courses. The student executes the following sequence of commands from her current working directory
ln -s file 1 file 2
ln -s file 2 file 3
Which of the following types of information would be lost from her file system? (I) Hobbies (II) Friends (III) Courses
  • (I) and (II) only
  • (II) and (III) only
  • (II) only
  • (I) and (III) only

Question 89

A user level process in Unix traps the signal sent on a Ctrl-C input, and has a signal handling routine that saves appropriate files before terminating the process. When a Ctrl-C input is given to this process, what is the mode in which the signal handling routine executes?
  • kernel mode
  • superuser mode
  • privileged mode
  • user mode

Question 90

A database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block of records for T2 simultaneously at any point in time. No index is available on either table. If Nested-loop join algorithm is employed to perform the join, with the most appropriate choice of table to be used in outer loop, the number of block accesses required for reading the data are  

  • 800000

  • 40080

  • 32020

  • 100

There are 90 questions to complete.

Last Updated :
Take a part in the ongoing discussion