Question
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
|
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?
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started