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

What will be the total number of max comparisons if we run brute-force maxima algorithm with n elements?

  1. A
    ?
    2
    n
  2. B
    ?
    2
    n
    n
  3. C
    ?
    n
    (Page 14)
  4. D
    ?
    8
Show correct answer

Correct answer: C. ?
n
(Page 14)

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

A RAM is an idealized machine with ______________ random-access memory.

  1. A
    ? 256MB
  2. B
    ? 512MB
  3. C
    ? an infinitely large (Page 10)
  4. D
    ? 100GB
Show correct answer

Correct answer: C. ? an infinitely large (Page 10)

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

Random access machine or RAM is a/an

  1. A
    ? Machine build by Al-Khwarizmi
  2. B
    ? Mechanical machine
  3. C
    ? Electronics machine
  4. D
    ? Mathematical model (Page 10)
Show correct answer

Correct answer: D. ? Mathematical model (Page 10)

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

al-Khwarizmi’s work was written in a book titled _______________

  1. A
    ?al Kitab al-mukhatasar fi hisab al-jabr wa’l-muqabalah
  2. B
    ?Abu Ja’far Mohammad ibn Musa al-Khowarizmi.
Show correct answer

Correct answer: A. ?al Kitab al-mukhatasar fi hisab al-jabr wa’l-muqabalah

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

word Algorithm comes from the name of the muslim author ____________

  1. A
    ?Abu Ja’far Mohammad ibn Musa al-Khowarizmi.
  2. B
    a
Show correct answer

Correct answer: A. ?Abu Ja’far Mohammad ibn Musa al-Khowarizmi.

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

What is the total time to heapify?

  1. A
    ? ?(log n) (Page 43)
  2. B
    ? ?(n log n)
  3. C
    ? ?(n2
    log n)
  4. D
    ? ?(log2
    n)
Show correct answer

Correct answer: A. ? ?(log n) (Page 43)

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

What type of instructions Random Access Machine (RAM) can execute?

  1. A
    ?Algebraic and logic
  2. B
    ?Geometric and arithmetic
  3. C
    ?Arithmetic and logic (Page 10)
  4. D
    ?Parallel and recursive
Show correct answer

Correct answer: C. ?Arithmetic and logic (Page 10)

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

Due to left complete nature of binary tree, the heap can be stored in

  1. A
    ? Arrays (Page 40)
  2. B
    ? Structures
  3. C
    ? Link Lis
  4. D
    ?Stack
Show correct answer

Correct answer: A. ? Arrays (Page 40)

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

Consider the following Algorithm:
Factorial (n){
if (n=1)
return 1
else
return (n * Factorial(n-1))
}
Recurrence for the following algorithm is:

  1. A
    ? T(n) = T(n-1) +1
  2. B
    ? T(n) = nT(n-1) +1
  3. C
    ? T(n)= T(n-1) +n
  4. D
    ? T(n)=T(n(n-1)) +1
Show correct answer

Correct answer: D. ? T(n)=T(n(n-1)) +1

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

One Example of in place but not stable sort is

  1. A
    ?Quick (Page 54)
  2. B
    ?Heap
  3. C
    ?Merge
  4. D
    ?Bubble
Show correct answer

Correct answer: A. ?Quick (Page 54)

Check community answers against your course notes.Question permalink ↗