Question: Exercise 1 1 Exercise 1 6 Exercises 1 9 , 2 0 , 2 1 Exercise 2 5 Exercise 3 2 algorithm. 4 . Write

Exercise 11
Exercise 16
Exercises 19,20,21
Exercise 25
Exercise 32
algorithm.
4. Write an Insertion Sort algorithm (Insertion Sort is discussed in Section 7.2) that uses Binary Search to find the position where the next insertion sould take place.
11
Determine the worst-case, average-case, and best-case time complexities for the basic Insertion Sort and for the version given in Exercise 4, which uses Binary Search
16
Using the definitions of O and , show that
6n2+20ninO(n3), but ,6n2+20n!in(n3).
19
The function f(x)=3n2+10nlogn+1000n+4logn+9999 belongs in which of the following complexity categories:
(a)(lgn)
(b)(n2logn)
(c)(n)
(d)(nlgn)
(e)(n2)
(f) None of these
20
The function f(x)=(logn)2+2n+4n+logn+50 belongs in which of the following complexity categories:
(a)(lgn)
(b)((logn)2)
(c)(n)
(d)(nlgn)
(e)(n(lgn)2)
(f) None of these
21
The function f(x)=n+n2+2n+n4 belongs in which of the following complexity categories:
(a)(n)
(b)(n2)
(c)(n3)
(d)(nlgn)
(e)(n4)
(f) None of these
Suppose you have a computer that requires 1 minute to solve problem instances of size n=1,000. Suppose you buy a new computer that runs 1,000 times faster than the old one. What instance sizes can be run in 1 minute, assuming the following time complexities T(n) for our algorithm?
(a)T(n)=n
(b)T(n)=n3
(c)T(n)=10n
What is the time complexity T(n) of the nested loops below? For simplicity, you may assume that n is a power of 2. That is,n=2k for some positive integer k.
for
j=n;
while
body of the while loop>//Needs (1).
}
j=|??j2??|;
}
 Exercise 11 Exercise 16 Exercises 19,20,21 Exercise 25 Exercise 32 algorithm.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!