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 · Midterm#10

When we call heapify then at each level the comparison performed takes time

  1. A
    It will take ? (1)
  2. B
    Time will vary according to the nature of input dat
  3. C
    It can not be predicted
Show correct answer

Correct answer: A. It will take ? (1)

Check community answers against your course notes.Question permalink ↗
CS502 · Midterm#9

Consider the following code:
For(j=1; j<n;j++)
For(k=1; k<15;k++)
For(l=5; l<n; l++)
{
Do_something_constant();
}
What is the order of execution for this code.

  1. A
    O(n)
  2. B
    O(n
    2
    log n)
  3. C
    O(n2
    )
Show correct answer

Correct answer: A. O(n)

Check community answers against your course notes.Question permalink ↗
CS502 · Midterm#8

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

  1. A
    O(logn)
  2. B
    O(n)
  3. C
    O(nlogn)
Show correct answer

Correct answer: B. O(n)

Check community answers against your course notes.Question permalink ↗
CS502 · Midterm#7

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

  1. A
    256MB
  2. B
    512MB
  3. C
    an infinitely large
Show correct answer

Correct answer: C. an infinitely large

Check community answers against your course notes.Question permalink ↗
CS502 · Midterm#6

Random access machine or RAM is a/an

  1. A
    Machine build by Al-Khwarizmi
  2. B
    Electronics machine
  3. C
    Mathematical model
Show correct answer

Correct answer: C. Mathematical model

Check community answers against your course notes.Question permalink ↗
CS502 · Midterm#5

What is the total time to heapify?

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

Correct answer: A. ?(log n)

Check community answers against your course notes.Question permalink ↗
CS502 · Midterm#4

For Chain Matrix Multiplication we can not use divide and conquer approach because

  1. A
    We do not know the optimum k (Page 86
  2. B
    We use divide and conquer for sorting only
  3. C
    We can easily perform it in linear time
Show correct answer

Correct answer: A. We do not know the optimum k (Page 86

Check community answers against your course notes.Question permalink ↗
CS502 · Midterm#3

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
  4. D
    Parallel and recursive
Show correct answer

Correct answer: C. Arithmetic and logic

Check community answers against your course notes.Question permalink ↗
CS502 · Midterm#2

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#1 · Lecture 1

MCQs

  1. A
    A
  2. B
    B
  3. C
    C
  4. D
    D
Show correct answer

Correct answer: B. B

Check community answers against your course notes.Question permalink ↗