PREVIOUS YEAR SOLVED PAPERS - GATE 2017 Shift 1

16. Let C1.......Cn be scalars, not all zero, such that

  • Option : C
  • Explanation :
    Since the scalars are not all zero
    ∓ The column vectors for i =1,2...,n are linearly dependent
    ⇒ |A| = 0 and ⇒ Ax = b has infinitely many solutions.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


17. Consider the C code fragment given below.
typedef struct node
{
int data;
node* next ;
} node;
void join(node* m, node* n)
{
node* p = n;
while (p->next != NULL)
{
p = p->next;
}
p–>next = m;
}
Assuming that m and n point to valid NULL- terminated linked lists, invocation of join will

  • Option : B
  • Explanation :
    In the given questions
    If lists are not NULL : Invocation of join will append list m to the end of list n if the lists are not NULL.
    Example:Before join operation :
    m =1->2->3->4->5->null
    n =6->7->8->9->nullAfter join operation :
    6->7->8->9->1->2->3->4->5->null
    & If lists are NULL : If the list n is empty and itself NULL, then joining and referencing would obviously create NULL pointer issue.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


18. The n-bit fixed-point representation of an unsigned real number real X uses f bits for the fraction part. Let The range of decimal values for X in this representation is

  • Option : D
  • Explanation :
    I=n-f.f
    Max value 111.....1 i times .111........1 (f times)

    = 2-i - 2f
    ∓ 0 to (2i - 2-f)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


19. Consider the following intermediate program in three address code
p = a - b
q = p * c
p = u * v
q = p + q
Which one of the following corresponds to a static single assignment form of the above code?

  • Option : B
  • Explanation :
    According to Static Single Assignment
    --> A variable cannot be used more than once in the LHS
    --> A variable should be initialized atmost once.
    Now looking at the given options
    1. a – code violates condition 1 as p1 is initialized again in this statement: p1 = u * v
    2. c- code is not valid as q1 = p2 * c , q2 = p4 + q3 – In these statements p2, p4, q3 are not initialized anywhere
    3. d- code is invalid as q2 = p + q is incorrect without moving it to register
    Therefore, option B is only correct option.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


20. Consider the C struct defined below:
struct data {
int marks [100];
char grade;
int cnumber;
};
struct data student;
The base address of student is available in register R1. The field student.grade can be accessed efficiently using

  • Option : D
  • Explanation :
    Direct access is possible with only index addressing mode.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


Related Quiz.
GATE 2017 Shift 1