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#120

Back edge is:

  1. A
    ? (u, v) where v is an ancestor of u in the tree. (Page 128)
  2. B
    ? (u,v) where u is an ancesstor of v in the tree.
  3. C
    ? (u, v) where v is an predcessor of u in the tree.
  4. D
    ?None of above
Show correct answer

Correct answer: A. ? (u, v) where v is an ancestor of u in the tree. (Page 128)

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

In digraph G=(V,E) ;G has cycle if and only if

  1. A
    ?The DFS forest has forward edge.
  2. B
    ?The DFS forest has back edge (Page 131)
  3. C
    ?The DFS forest has both back and forward edge
  4. D
    ?BFS forest has forward edge
Show correct answer

Correct answer: B. ?The DFS forest has back edge (Page 131)

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

If you find yourself in maze the better traversal approach will be :

  1. A
    ?BFS Click here for detail
  2. B
    ?BFS and DFS both are valid
  3. C
    ?Level order
  4. D
    ?DFS
Show correct answer

Correct answer: A. ?BFS Click here for detail

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

What general property of the list indicates that the graph has an isolated vertex?

  1. A
    ?There is Null pointer at the end of list.
  2. B
    ?The Isolated vertex is not handled in list.
  3. C
    ? Only one value is entered in the list.
  4. D
    ?There is at least one null list.
Show correct answer

Correct answer: B. ?The Isolated vertex is not handled in list.

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

Forward edge is:

  1. A
    ? (u, v) where u is a proper descendent of v in the tree.
  2. B
    ? (u, v) where v is a proper descendent of u in the tree. (Page 129)
  3. C
    ? (u, v) where v is a proper ancesstor of u in the tree.
  4. D
    ? (u, v) where u is a proper ancesstor of v in the tree.
Show correct answer

Correct answer: B. ? (u, v) where v is a proper descendent of u in the tree. (Page 129)

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

Which is true statement?

  1. A
    ?Breadth first search is shortest path algorithm that works on un-weighted graphs (Page 153)
  2. B
    ?Depth first search is shortest path algorithm that works on un-weighted graphs.
  3. C
    ?Both of above are true.
    ?
  4. D
    None of above are true.
Show correct answer

Correct answer: A. ?Breadth first search is shortest path algorithm that works on un-weighted graphs (Page 153)

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

Suppose that a graph G = (V,E) is implemented using adjacency lists. What is the complexity of a breadth-first
traversal of G?

  1. A
    ?O(|V |^2)
  2. B
    ?O(|V | |E|)
  3. C
    ?O(|V |^2|E|)
  4. D
    ?O(|V | + |E|) pg 116
Show correct answer

Correct answer: D. ?O(|V | + |E|) pg 116

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

A dense undirected graph is:

  1. A
    ? A graph in which E = O(V^2) click here 4 detail
  2. B
    ?A graph in which E = O(V)
  3. C
    ?A graph in which E = O(log V)
  4. D
    ?All items above may be used to characterize a dense undirected graph
Show correct answer

Correct answer: A. ? A graph in which E = O(V^2) click here 4 detail

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

An application problem is one in which you want to find, not just a solution, but the ____ solution.

  1. A
    ?Simple
  2. B
    ?Good
  3. C
    ?Best
  4. D
    ?Worst
Show correct answer

Correct answer: B. ?Good

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

The string |xyz|, if coded with ASCII code, the message length would be 24 bits.

  1. A
    ?True (3*8=24)
  2. B
    ?False
Show correct answer

Correct answer: A. ?True (3*8=24)

Check community answers against your course notes.Question permalink ↗