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

The activity scheduling is a simple scheduling problem for which the greedy algorithm approach provides a/an
________solution.

  1. A
    ?Simple
  2. B
    ?Sub optimal
  3. C
    ?Optimal (Page 105)
  4. D
    ?Non optimal
Show correct answer

Correct answer: C. ?Optimal (Page 105)

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

A number of lectures are to be given in a single lecture hall. Optimum scheduling for this is an example of
Activity selection.

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

Correct answer: A. ?True (Page 105)

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

Inductive approach to compute entries of V is implied in _____ based solution of knapsack problem.

  1. A
    ?Brute force
  2. B
    ?Dynamic programming (
Show correct answer

Correct answer: B. ?Dynamic programming (

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

There are _________ nested loops in DP based algorithm for computing the minimum cost of chain matrix
multiplication.

  1. A
    ?2
  2. B
    ?3 (Page 90)
  3. C
    ?4
  4. D
    ?5
Show correct answer

Correct answer: B. ?3 (Page 90)

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

If the string “lmncde” is coded with ASCII code, the message length would be _______ bits.

  1. A
    ?24
  2. B
    ?36
  3. C
    ?48 (6*8=48)
  4. D
    ?60
Show correct answer

Correct answer: C. ?48 (6*8=48)

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

Huffman algorithm generates an optimum prefix code.

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

Correct answer: A. ?True (Page 102)

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

Counting Money problem is an example which cannot be optimally solved by greedy algorithm.

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

Correct answer: A. ?True (Page 97)

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

Huffman algorithm uses a greedy approach to generate an prefix code T that minimizes the expected length B
(T) of the encoded string.

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

Correct answer: A. ? ?True (Page 102)

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

In _______ algorithm, you hope that by choosing a local optimum at each step, you will end up at a global
optimum.

  1. A
    ?Simple
  2. B
    ?Non Greedy
  3. C
    ?Greedy (Page 97)
  4. D
    ?Brute force
Show correct answer

Correct answer: C. ?Greedy (Page 97)

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

Using ASCII standard the string abacdaacac will be encoded with 10 bytes.

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

Correct answer: A. ? ?True (Page 101)

Check community answers against your course notes.Question permalink ↗