Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question: Comparison of Sorts In class, we discussed two quadratic sorting algorithms (Insertion-Sort and Selection-Sort) aswell as onenlgnsorting algorithm (Merge-Sort). Dozens, if not hundreds, of

image text in transcribedimage text in transcribedimage text in transcribed

Question:

Comparison of Sorts

In class, we discussed two quadratic sorting algorithms (Insertion-Sort and Selection-Sort) aswell as onenlgnsorting algorithm (Merge-Sort). Dozens, if not hundreds, of other sorting algo-rithms have been developed. Another well-known sorting algorithm isShell?Sortwhose asymp-totic running time is on the order ofnlg2n, when implemented appropriately.

In the problems that follow, you will compare these three algorithms for sorting. Ignoringlower order terms and constant factors, letT1(n),T2(n), andT3(n) be the "effort" required byInsertion/Selection-Sort, Shell-sort, and Merge-Sort, respectively, to sort a list of lengthn. We have:

T1(n) =n2

T2(n) =nlg2n

T3(n) =nlgn

where lgnis log2(n) and lg2n= (lgn)2

i.On asinglesheet of graph paper, plot the effort required by each of the these algorithmswhen run on lists of lengthn= 2, 4, 8, 16, and 32. For each algorithm, connect the plotpoints with a smooth, hand-drawn curve. See the plots given in the "Exponentials and Logs"appendix of the text for examples of what you should do. You may print a piece of graphpaper from the PDF located at the following URL:

ii.Suppose that you were given a budget of 1,000 units of "effort." For each of the threealgorithms, determine the largest list length such that the sorting effort required is guaranteedto be at most 1,000.

iii.How many times larger is the list that Merge-Sort can handle, as compared to the lists thatInsertion/Selection-Sort and Shell-sort can handle? How many times larger is the list thatShell-sort can handle, as compared to the list that Insertion/Selection-Sort can handle?

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
Question 1: (a) A Markov chain {Xn} on the state space S = {0,1,2} has the transition probabilities matrix: 0.3 0.2 0.51 P = 0.2 0.7 0.1 0 0.4 0.6] Find (i) The two-steps transition probability matrix (3 marks) (ii) P[X2 = 2, X3 = 1/X1 = 0] (4 marks)Discussion Problem WO1b-02: Expected Activity Time and SD? Act 1+4x3+5 = Jn. 12-4. V = ( =1.78 UmInMOONmTHAN m SEEM 3530 PERTExample: Shopping Mall Renovation Activity A: Prepare initial design B: Identify new potential clients C: Develop prospectus for tenants D: Prepare final design U minmONmy IITTOWOO E: Obtain planning permission On NHAMInHAM OATNHANHOH F: Obtain finance from bank G: Select contractor H: Construction LUI WU I: Finalize tenant contracts J: Tenants move in I H SEEM 3530 PERTEstimation of the activity duration Three key values we use in the time estimate for each activity: a = optimistic time, which means that there is little chance that the activity can be completed before this time; c = most likely time, which will be required if the execution is normal; b = pessimistic time, which means that there is little chance that the activity will take longer

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

Partial Differential Equations For Scientists And Engineers

Authors: Stanley J Farlow

1st Edition

0486134733, 9780486134734

More Books

Students also viewed these Mathematics questions

Question

List t he t hree c omponents of ident ity. (p. 3 0)

Answered: 1 week ago

Question

identify the major consequences of burnout, boredom and engagement;

Answered: 1 week ago