Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help answeting the following 9 questions. I know it looks crazy but it's only 9 Multiple Choice questions. 1. What is the Big

I need help answeting the following 9 questions. I know it looks crazy but it's only 9 Multiple Choice questions.

1. What is the Big O of the following function? Assume a and b are constants. x is a variable. x = a + b Return x

a. Big O (0)

b. Big O (1)

c. Big O (2)

d. Big O (3)

2. What is the Big O of the following function? Assume i is a loop counter variable and n is a constant. For i = 1 to n do print i

a. Big O (n2)

b. Big O (0)

c. Big O (1)

d. Big O (n)

3. Which of the following about Big O is correct?

a. Big O is about how difficult it is for humans to understand an algorithm

b. Big O is fodder for llama

c. Big O is about the complexity of a function

d. Big O is about how a function uses different variables to generate an outcome

4. What is the Big O of a function that looks up a certain item on an unsorted list? (linear search)

a. O(n)

b. O(logn)

c. O(nlogn)

d. O(1)

5. What is the Big O of merge sort in a worst case scenario?

a. O(1)

b. O(N)

c. O(N^2)

d. O(logN)

e. O(NlogN)

6. What is the Big O of merge sort in a best case scenario?

a. O(N^2)

b. O(logN)

c. O(N)

d. O(1)

e. O(NlogN)

7. What is the Big O of quick sort in a worst case scenario?

a. O(1)

b. O(N^2)

c. O(NlogN)

d. O(N)

e. O(logN)

8. What is the Big O of quick sort in a best case scenario?

a. O(NlogN)

b. O(N^2)

c. O(1)

d. O(N)

e. O(logN)

9. What is the Big O of searching on a sorted list?

a. O(N^2)

b. O(NlogN)

c. O(N)

d. O(logN)

e. O(1)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions