GATE CS 1994 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0271

In a compact single dimensional array representation for lower triangular matrices (i.e all the elements above the diagonal are zero) of size \(n \times n\), non-zero elements, (i.e elements of lower triangle) of each row are stored one after another, starting from the first row, the index of the \((i, j)^{th}\) element of the lower triangular matrix in this new representation is:
  1. A
    \(i+j\)
  2. B
    \(i+j-1\)
  3. C
    \((j-1)+\frac{i(i-1)}{2}\)
  4. D
    \(i+\frac{j(j-1)}{2}\)

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option C.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/2452/gate1994-1-11

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com