Question
1. What is the BigO () of the Linear Search algorithm? A) n**2 (n to the power 2) B) (n) C) log(n) D) n**3 (n
1. What is the BigO () of the Linear Search algorithm?
A) n**2 (n to the power 2)
B) (n)
C) log(n)
D) n**3 (n to the power 3)
E) None of the above
2. What is the BigO () of the Binary Search algorithm?
A) n**2 (n to the power 2)
B) log(n)
C) n*log(n)
D) n**3 (n to the power 3)
E)None of the above
3. What is the BigO () of the following code fragment?
for(i=1; i <= n; i++){
m = m*2;
}
A)n**2 (n to the power 2)
B)log(n)
C) n*log(n)
D) n
E) None of the above
4. The summation of integers can be represented by the following sum function
Sum (n) = 1 + 2 + 3 ... + n
Which of the following will be the value of Sum (n)?
A) n(n+1)
B) (1/2)(n**2) + (1/2)n {n**2 means n to the power 2}
C) (n+1)(n+2)
D) (1/2)(2n+1)(2n+3)
E) None of the above
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