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

In Sieve Technique we do not know which item is of interest

  1. A
    ?True (Page 34)
  2. B
    ?False
Show correct answer

Correct answer: A. ?True (Page 34)

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

Divide-and-conquer as breaking the problem into a small number of

  1. A
    ?pivot
  2. B
    ?Sieve
  3. C
    ?smaller sub problems (Page 34)
  4. D
    ?Selection
Show correct answer

Correct answer: C. ?smaller sub problems (Page 34)

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

A heap is a left-complete binary tree that conforms to the ___________

  1. A
    ?increasing order only
  2. B
    ?decreasing order only
  3. C
    ?heap order (Page 40)
  4. D
    ? (log n) order
Show correct answer

Correct answer: C. ?heap order (Page 40)

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

Sieve Technique can be applied to selection problem?

  1. A
    ?True (Page 35)
  2. B
    ?False
Show correct answer

Correct answer: A. ?True (Page 35)

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

Heaps can be stored in arrays without using any pointers; this is due to the ____________ nature of the binary
tree,

  1. A
    ?left-complete (Page 40)
  2. B
    ?right-complete
  3. C
    ?tree nodes
  4. D
    ?tree leaves
Show correct answer

Correct answer: A. ?left-complete (Page 40)

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

Counting sort is suitable to sort the elements in range 1 to k:

  1. A
    ?K is large
  2. B
    ?K is small (Page 57)
  3. C
    ?K may be large or small
  4. D
    ?None
Show correct answer

Correct answer: B. ?K is small (Page 57)

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

Slow sorting algorithms run in,

  1. A
    ?T(n^2) (Page 39)
  2. B
    ?T(n)
  3. C
    ?T( log n)
  4. D
    ?T(n log n)
Show correct answer

Correct answer: A. ?T(n^2) (Page 39)

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

How many elements do we eliminate in each time for the Analysis of Selection algorithm?

  1. A
    ?n / 2 elements (Page 37)
  2. B
    ? (n / 2) + n elements
  3. C
    ?n / 4 elements
  4. D
    ?2 n elements
Show correct answer

Correct answer: A. ?n / 2 elements (Page 37)

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

The number of nodes in a complete binary tree of height h is

  1. A
    ?2^(h+1) – 1 (Page 40)
  2. B
    ?2 * (h+1) – 1
  3. C
    ?2 * (h+1)
  4. D
    ? ((h+1) ^ 2) – 1
Show correct answer

Correct answer: A. ?2^(h+1) – 1 (Page 40)

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

In the analysis of Selection algorithm, we make a number of passes, in fact it could be as many as,

  1. A
    ?T(n)
  2. B
    ?T(n / 2)
  3. C
    ?log n (Page 37)
  4. D
    ?n / 2 + n / 4
Show correct answer

Correct answer: C. ?log n (Page 37)

Check community answers against your course notes.Question permalink ↗