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

In Quick Sort Constants hidden in T(n log n) are

  1. A
    ?Large
  2. B
    ?Medium
  3. C
    ?Small Click here for detail
  4. D
    ?Not Known
Show correct answer

Correct answer: C. ?Small Click here for detail

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

Which may be stable sort:

  1. A
    ?Bubble sort
  2. B
    ?Insertion sort
  3. C
    ?Both of above
Show correct answer

Correct answer: C. ?Both of above

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

The running time of quick sort depends heavily on the selection of

  1. A
    ?No of inputs
  2. B
    ?Arrangement of elements in array
  3. C
    ?Size o elements
  4. D
    ?Pivot elements
Show correct answer

Correct answer: D. ?Pivot elements

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

Counting sort has time complexity:

  1. A
    ?O(n)
  2. B
    ?O(n+k)
  3. C
    ?O(k)
  4. D
    ?O(nlogn)
Show correct answer

Correct answer: A. ?O(n)

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

Sorting is one of the few problems where provable ________ bonds exits on how fast we can sort,

  1. A
    ?upper
  2. B
    ?lower
  3. C
    ?average
  4. D
    ?log n
Show correct answer

Correct answer: B. ?lower

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

In place stable sorting algorithm.

  1. A
    ?If duplicate elements remain in the same relative position after sorting
  2. B
    ?One array is used
  3. C
    ?More than one arrays are required
  4. D
    ?Duplicating elements not handled
Show correct answer

Correct answer: A. ?If duplicate elements remain in the same relative position after sorting

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

Cont sort is suitable to sort the elements in range 1 to k

  1. A
    ?K is Large
  2. B
    ?K is not known
  3. C
    ?K may be small or large
  4. D

    ?K is small
Show correct answer

Correct answer: D.
?K is small

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

Memoization is?

  1. A
    ?To store previous results for future use
  2. B
    ?To avoid this unnecessary repetitions by writing down the results of recursive calls and looking them
    up again if we need them later (page 74)
  3. C
    ?To make the process accurate
  4. D
    ?None of the above
Show correct answer

Correct answer: B. ?To avoid this unnecessary repetitions by writing down the results of recursive calls and looking them
up again if we need them later (page 74)

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

How much time merge sort takes for an array of numbers?

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

Correct answer: D. ?T(n log n)

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

In the analysis of Selection algorithm, we eliminate a constant fraction of the array with each phase; we get the
convergent _______________ series in the analysis,

  1. A
    ?linear
  2. B
    ?arithmetic
  3. C
    ?geometric
  4. D
    ?exponen
Show correct answer

Correct answer: C. ?geometric

Check community answers against your course notes.Question permalink ↗