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

Merge sort requires extra array storage,

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

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

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

One of the clever aspects of heaps is that they can be stored in arrays without using any____________.

  1. A
    ? ?Pointers (Page 40)
  2. B
    ? ?constants
  3. C
    ? ?variables
  4. D
    ? ?functions
Show correct answer

Correct answer: A. ? ?Pointers (Page 40)

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

Can an adjacency matrix for a directed graph ever not be square in shape?

  1. A
    ? ?Yes
  2. B
    ? ?No click here 4 detail
Show correct answer

Correct answer: B. ? ?No click here 4 detail

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

A greedy algorithm does not work in phases.

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

Correct answer: B. ?False (Page 97)

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

Consider the following Huffman Tree
The binary code for the string TEA is

  1. A
    ? ?10 00 010 click here 4 detail
  2. B
    ? ?011 00 010
  3. C
    ? ?10 00 110
  4. D
    ? ?11 10 110
Show correct answer

Correct answer: A. ? ?10 00 010 click here 4 detail

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

What is the solution to the recurrence T(n) = T(n/2)+n, T(1) = 1

  1. A
    ? ?O(logn)
  2. B
    ? ?O(n) (Page 37)
  3. C
    ? ?O(nlogn)
  4. D
    ? ?O(2n)
Show correct answer

Correct answer: B. ? ?O(n) (Page 37)

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

Who invented Quick sort procedure?

  1. A
    ? ?Hoare click here 4 detail
  2. B
    ? ?Sedgewick
  3. C
    ? ?Mellroy
  4. D
    ? ?Coreman
Show correct answer

Correct answer: A. ? ?Hoare click here 4 detail

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

Merge sort makes two recursive calls. Which statement is true after these recursive calls finish, but before the
merge step?

  1. A
    ? ?The array elements form a heap
  2. B
    ? ?Elements in each half of the array are sorted amongst themselves click here 4 detail
  3. C
    ? ?Elements in the first half of the array are less than or equal to elements in the second half of the array
  4. D
    ? ?None of the above
Show correct answer

Correct answer: B. ? ?Elements in each half of the array are sorted amongst themselves click here 4 detail

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

Which of the following is calculated with big o notation?

  1. A
    ? ?Lower bounds
  2. B
    ? ?Upper bounds
  3. C
    ? ?Both upper and lower bound
  4. D
    ? ?Medium bounds
Show correct answer

Correct answer: B. ? ?Upper bounds

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

_______________ is a graphical representation of an algorithm

  1. A
    ?
    E?
    notation
  2. B
    ?
    ?
    notation
  3. C
    ? Flowchart
  4. D
    ? Asymptotic notation
Show correct answer

Correct answer: C. ? Flowchart

Check community answers against your course notes.Question permalink ↗