Review Questions on Big-O Notation

  1. 1 point
    Are these two equal?


    O(n) == O(2n + 12345)


  2. 1 point
    Imagine we have two loops which execute in series (one after another). Each of the loops executes n times. Which of the following is the most simplified Big O of this code segment?
  3. 1 point

    Consider the following function:


    F(N) = 17N2 + 5N + 20


    Is this function O(N3)?

  4. 1 point
    What is the Big O of a bubble sort algorithm?
  5. 1 point
    Imagine we have a sorted list containing n items. We want to add a new element to it using the insertion sort algorithm. The time it will take to do this can be measured by which of the following Big O notations?
  6. 1 point
    What is the Big O of a QuickSort algorithm?
  7. 1 point
    What is the Big O of a bisection (also called binary) search?
  8. 1 point
    What is the Big O of a linear (also called sequential) search?
  9. 1 point
    Imagine we have two loops that are nested. Say that the outer loop executes n times and the inner loop also executes n times. Which of the following would represent the Big O of this code segment?
  10. 1 point
    Imagine we have two loops that are nested. Say that the outer loop executes n/2 times and the inner loop executes n times. Which of the following would represent the Big O of this code segment?