Computer Knowledge

Data Structures and Algorithms

1,256 Questions

Data Structures and Algorithms form the core of computer science, focusing on arrays, linked lists, trees, and sorting mechanisms. These concepts are essential for solving complex computational problems efficiently. Test takers preparing for technical and administrative IT exams will find these questions highly relevant.

Array OperationsLinked List ApplicationsSorting AlgorithmsTree Data StructuresMultilevel IndexingAlgorithm Time Complexity

Data Structures and Algorithms Questions

Multiple choice
  1. $\odot$(n) and $\odot$(n)
  2. $\odot$(2n) and $\odot$(n)
  3. $\odot$(n) and $\odot$(2n)
  4. $\odot$(2n) and $\odot$ (2n)
Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Multiple choice
  1. Y is [1 2 3 4 5 6 7 8 9 10] and x <10

  2. Y is [1 3 5 7 9 11 13 15 17 19] and x < 1

  3. Y is [2 2 2 2 2 2 2 2 2 2] and x > 2

  4. Y is [2 4 6 8 10 12 14 16 18 20] and 2 < x < 20 and x is even

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Multiple choice
  1. Change line 6 to : if Y[k] < x) i = k + 1; else j = k - 1;

  2. Change line 6 to : if Y[k] < x) i = k - 1; else j = k + 1;

  3. Change line 6 to : if Y[k] <= x) i = k; else j = k;

  4. Change line 7 to:} while ((Y[K] ==x) && (i < j));

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Multiple choice
  1. 1,2,3, 4,5, 6, 7

  2. 2,1, 4,3, 6,5, 7

  3. 1,3, 2,5, 4, 7, 6

  4. 2, 3, 4,5, 6, 7,1

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Multiple choice
  1. 8 and 0

  2. 128 and 6

  3. 256 and 4

  4. 512 and 5

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Multiple choice
  1. All elements L should be initialized to 0 for the values of l(i, j) to be properly computed.

  2. The values of l(i, j) may be computed in a row major order or column major order of L(M,N).

  3. The values of l(i, j) cannot be computed in either row major order or column major order of L(M,N).

  4. L[p, q] needs to be computed before L[r, s] if either p<r or q<s.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Multiple choice
  1. expr1 = l (i − 1, j) + 1

  2. expr1 = l (i, j − 1)

  3. expr2 = max (l (i − 1, j), l (i,j - 1))

  4. expr2 = max (l (i − 1, j − 1), l (i, j))

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation