YOUR SUBJECT CS502 Fundamentals of AlgorithmsChange subject ↗
PRACTICE AT YOUR OWN PACE

CS502 practice questions

Think through the options before revealing the answer. Use the term filter to focus your revision.

260 questions
CS502 · Final-term only#130

In stable sorting algorithm

  1. A
    ?One array is used
  2. B
    ?In which duplicating elements are not handled.
  3. C
    ?More then one arrays are required.
  4. D
    ?Duplicating elements remain in same relative position after sorting. (Page 54)
Show correct answer

Correct answer: D. ?Duplicating elements remain in same relative position after sorting. (Page 54)

Check community answers against your course notes.Question permalink ↗
CS502 · Final-term only#129

In in-place sorting algorithm is one that uses arrays for storage :

  1. A
    ?An additional array
  2. B
    ?No additional array (Page 54)
  3. C
    ?Both of above may be true according to algorithm
  4. D
    ?More than 3 arrays of one dimension.
Show correct answer

Correct answer: B. ?No additional array (Page 54)

Check community answers against your course notes.Question permalink ↗
CS502 · Final-term only#128

A digraph is strongly connected under what condition?

  1. A
    ?A digraph is strongly connected if for every pair of vertices u, v e V, u can reach v .
  2. B
    ?A digraph is strongly connected if for every pair of vertices u, v e V, u can reach v and vice versa.
    (Page 135)
  3. C
    ?A digraph is strongly connected if for at least one pair of vertex u, v e V, u can reach v and vice versa.
  4. D
    ?A digraph is strongly connected if at least one third pair of vertices u, v e V, u can reach v and vice versa.
Show correct answer

Correct answer: B. ?A digraph is strongly connected if for every pair of vertices u, v e V, u can reach v and vice versa.
(Page 135)

Check community answers against your course notes.Question permalink ↗
CS502 · Final-term only#127

There is relationship between number of back edges and number of cycles in DFS

  1. A
    ?Both are equal.
  2. B
    ?Cycles are half of back edges.
  3. C
    ?Cycles are one fourth of back edges.
  4. D
    ?There is no relationship between back edges and number of cycles.
Show correct answer

Correct answer: D. ?There is no relationship between back edges and number of cycles.

Check community answers against your course notes.Question permalink ↗
CS502 · Final-term only#126

You have an adjacency list for G, what is the time complexity to compute Graph transpose G^T.?

  1. A
    ? (V + E) (Page 138)
  2. B
    ? (V E)
  3. C
    ? (V)
  4. D
    ? (V^2)
Show correct answer

Correct answer: A. ? (V + E) (Page 138)

Check community answers against your course notes.Question permalink ↗
CS502 · Final-term only#125

The relationship between number of back edges and number of cycles in DFS is,

  1. A
    ?Both are equal
  2. B
    ?Back edges are half of cycles
  3. C
    ?Back edges are one quarter of cycles
  4. D
    ?There is no relationship between no. of edges and cycles
Show correct answer

Correct answer: D. ?There is no relationship between no. of edges and cycles

Check community answers against your course notes.Question permalink ↗
CS502 · Final-term only#124

What is the time complexity to extract a vertex from the priority queue in Prim’s algorithm?

  1. A
    ?O (log E)
  2. B
    ? (V)
  3. C
    ? (V+E)
  4. D
    ?O (log V)
Show correct answer

Correct answer: D. ?O (log V)

Check community answers against your course notes.Question permalink ↗
CS502 · Final-term only#123

What algorithm technique is used in the implementation of Kruskal solution for the MST?

  1. A
    ?Greedy Technique (Page 142)
  2. B
    ?Divide-and-Conquer Technique
  3. C
    ?Dynamic Programming Technique
  4. D
    ?The algorithm combines more than one of the above techniques
Show correct answer

Correct answer: A. ?Greedy Technique (Page 142)

Check community answers against your course notes.Question permalink ↗
CS502 · Final-term only#122

Cross edge is :

  1. A
    ? (u, v) where u and v are not ancestor of one another
  2. B
    ? (u, v) where u is ancesstor of v and v is not descendent of u.
  3. C
    ? (u, v) where u and v are not ancestor or descendent of one another (Page 129)
  4. D
    ? (u, v) where u and v are either ancestor or descendent of one another.
Show correct answer

Correct answer: C. ? (u, v) where u and v are not ancestor or descendent of one another (Page 129)

Check community answers against your course notes.Question permalink ↗
CS502 · Final-term only#121

Which statement is true?

  1. A
    ?If a dynamic-programming problem satisfies the optimal-substructure property, then a locally optimal
    solution is globally optimal.
  2. B
    ?If a greedy choice property satisfies the optimal-substructure property, then a locally optimal solution is
    globally optimal.
  3. C
    ? Both of above
  4. D
    ?None of above
Show correct answer

Correct answer: C. ? Both of above

Check community answers against your course notes.Question permalink ↗