Question: ( a ) Approximate the runtime complexity for the following block of code. [ NB: Do not find Time ( b ) Assume that each

(a) Approximate the runtime complexity for the following block of code. [NB: Do not find Time
(b) Assume that each of the expressions below gives the processing time T(n) spent by an algorithm for
solving a problem of size n. Select the dominant term(s) having the steepest increase in n and
specify the lowest Big Oh complexity of each algorithm.(c) What type of algorithm block will give rise to a time complexity of O(MNP)? Explain with an
example of your own.
(d) If an algorithm is O(n2) and it runs for 20 seconds for a problem size (n) of 1000. If the problem size
increases to 10000, approximate how much time (or cost of execution) in seconds the algorithm
requires to complete processing the 10000 sized problem?Question 2 Searching and Sorting
(a) List all the divide and conquer algorithms covered in class.
(b) Determine which search algorithm would you apply to search for an item in a list of unsorted items.
State the reasons why your choice is the best for this search.
(c) On the sorted input list, what is the running time of insertion sort, shellsort, mergesort, and
quicksort?
(d) Sort the sequence 8,1,4,2,5,9,3,7,6 using insertion sort. Show working.

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 Programming Questions!