ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 22 May 2017 My Price 8.00

Prove that the following recursive algorithm

1.)

Prove that the following recursive algorithm actually sorts its input.

3PASS-SORT ( A[0],...,A[n-1] ):

if n=2 and A[0] > A[1] swap A[0] with A[1]

else (n>2)

m = ceiling(2n/3)

3PASS-SORT( A[0],...,A[m-1] )

3PASS-SORT( A[n-m],...,A[n-1] )

3PASS-SORT( A[0],...,A[m-1] )

 

b) Suppose we replaced ceiling by floor. Is your correctness proof for a) still valid?

If it is, explain, for each statement in your proof, why it still holds. If it isn't,

find the first statement that is false (and explain why it is).

 

c) State a recurrence relation, including base case(s), for the number of times 3PASSSORT

compares two elements of A. Explain how each part of your recurrence links

to the algorithm.

 

d) State and prove upper and lower bounds for the solution to your recurrence. Your

bounds should be tight up to constant factors (and therefore expressible using

O, Ω, Θ notation).

Answers

(11)
Status NEW Posted 22 May 2017 01:05 AM My Price 8.00

-----------

Not Rated(0)