Linear Data Structures questions — page 2 of 2

Q17

GATE CS 2015 CS-3Linear Data StructuresNAT1 mark
Consider a software project with the following information domain characteristics for calculation of function point metric.

Number of external inputs (I) = 30
Number of external outputs (O) = 60
Number of external inquiries (E) = 23
Number of files (F) = 08
Number of external interfaces (N) = 02

It is given that the complexity weighting factors for I, O, E, F and N are 4, 5, 4, 10 and 7, respectively. It is also given that, out of fourteen value adjustment factors that influence the development effort, four factors are not applicable, each of the other four factors have value 3, and each of the remaining factors have value 4. The computed value of function point metric is ____________.
Show answer without attempting

Answer: 612 to 613

Q28

GATE CS 2015 CS-3Linear Data StructuresMCQ1 mark−1/3 if wrong
The result evaluating the postfix expression 10  5  +  60  6  /  ∗  8  −10 \; 5 \; + \; 60 \; 6 \; / \; * \; 8 \; - is
Show answer without attempting

Answer: C

Q33

GATE CS 2015 CS-3Linear Data StructuresNAT1 mark
Consider a software program that is artificially seeded with 100 faults. While testing this program, 159 faults are detected, out of which 75 faults are from those artificially seeded faults. Assuming that both real and seeded faults are of same nature and have same distribution, the estimated number of undetected real faults is ____________.
Show answer without attempting

Answer: 28

Q63

GATE CS 2015 CS-3Linear Data StructuresNAT2 marks
Suppose c=⟨c[0],…,c[k−1]⟩c = \langle c[0], \dots, c[k-1] \rangle is an array of length kk, where all the entries are from the set {0,1}\{0, 1\}. For any positive integers aa and nn, consider the following pseudocode.
DOSOMETHING(c, a, n)
z ← 1
for i ← 0 to k − 1
    do z ← z² mod n
       if c[i] = 1
          then z ← (z × a) mod n
return z
If k=4k = 4, c=⟨1,0,1,1⟩c = \langle 1, 0, 1, 1 \rangle, a=2a = 2 and n=8n = 8, then the output of DOSOMETHING(c,a,nc, a, n) is ____________.
Show answer without attempting

Answer: 0

Q48

GATE CS 2015 CS-2Linear Data StructuresNAT2 marks
A Young tableau is a 2D array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with ∞\infty, and hence there cannot be any entry to the right of, or below a ∞\infty. The following Young tableau consists of unique entries.

When an element is removed from a Young tableau, other elements should be moved into its place so that the resulting table is still a Young tableau (unfilled entries may be filled in with a ∞\infty). The minimum number of entries (other than 1) to be shifted, to remove 1 from the given Young tableau is _______________.
Question figure
Show answer without attempting

Answer: 5

Q52

GATE CS 2015 CS-2Linear Data StructuresNAT2 marks
Consider the C program below.
#include <stdio.h>
int *A, stkTop;

int stkFunc(int opcode, int val)
{
    static int size=0, stkTop=0;

    switch (opcode) {
        case -1: size = val; break;
        case  0: if (stkTop < size) A[stkTop++] = val; break;
        default: if (stkTop) return A[--stkTop];
    }
    return -1;
}

int main()
{
    int B[20]; A = B; stkTop = -1;

    stkFunc (-1, 10);
    stkFunc ( 0, 5);
    stkFunc ( 0, 10);
    printf ("%d\n", stkFunc(1, 0) + stkFunc(1, 0));
}
The value printed by the above program is ___________.
Show answer without attempting

Answer: 15

Q41

GATE CS 2014 CS-2Linear Data StructuresMCQ2 marks−2/3 if wrong
Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack?
Show answer without attempting

Answer: C

Q10

GATE CS 2014 CS-3Linear Data StructuresMCQ1 mark−1/3 if wrong
Let AA be a square matrix of size n×nn \times n. Consider the following pseudocode. What is the expected output?
C = 100;
for i = 1 to n do
  for j = 1 to n do
  {
    Temp = A[i][j] + C;
    A[i][j] = A[j][i];
    A[j][i] = Temp - C;
  }
for i = 1 to n do
  for j = 1 to n do
    output (A[i][j]);
Show answer without attempting

Answer: A

Q42

GATE CS 2014 CS-3Linear Data StructuresMCQ2 marks−2/3 if wrong
Consider the C function given below. Assume that the array listA contains n (> 0) elements, sorted in ascending order.
int ProcessArray(int *listA, int x, int n)
{
  int i, j, k;
  i = 0;
  j = n-1;
  do {
    k = (i+j)/2;
    if (x <= listA[k])
      j = k-1;
    if (listA[k] <= x)
      i = k+1;
  }while (i <= j);
  if (listA[k] == x)
    return(k);
  else
    return -1;
}
Which one of the following statements about the function ProcessArray is CORRECT?
Show answer without attempting

Answer: B

Q44

GATE CS 2013 CSLinear Data StructuresMCQ2 marks−2/3 if wrong
Consider the following operation along with Enqueue and Dequeue operations on queues, where kk is a global parameter.
MultiDequeue(Q){
  m = k
  while (Q is not empty) and (m > 0) {
    Dequeue(Q)
    m = m – 1
  }
}
What is the worst case time complexity of a sequence of nn queue operations on an initially empty queue?
Show answer without attempting

Answer: A

Q35

GATE CS 2012 CSLinear Data StructuresMCQ2 marks−2/3 if wrong
Suppose a circular queue of capacity (n−1)(n - 1) elements is implemented with an array of nn elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
Show answer without attempting

Answer: A

0/110 correct0 marks

Related topics in Programming and Data Structures