Sort the array 15 80 35 25 60 30 into descending order

Assignment Help Data Structure & Algorithms
Reference no: EM13944037

Part (A) Sort the array 15 80 35 25 60 30 into descending order using

a) the selection sort.

b) the buble sort.

Part (B) A first year student attempted to write mergesort in pseudocode as follows.

mergesort(theArray, n) {

if (n > 1){ // more than one item to sort

mergesort(left half of theArray, n/2)

mergesort(right half of theArray, n/2)

}

}

a) The above algorithm has a fundamental flaw. As written, how does it change theArray?

b) What is the worst-case runtime of this incorrect algorithm? Give as tight an asymptotic upper bound as possible, using Big-Oh notation as a function of n. Justify your answer.

The original course website where the problem comes from is here, I think it will be helpful if you take a look at it first: www.student.math.uwaterloo.ca/~cs134

Reference no: EM13944037

Questions Cloud

Theoretical and methodological issues in research : Reflect critically on theoretical and methodological issues in research, including critically evaluating published journal articles;
A perfectly competitive firm has total revenue : A perfectly competitive firm has total revenue and total cost curves given by: TR = 100QTC = 5,000 + 2Q + 0.2 Q2 a. Find the profit-maximizing output for this firm.
What is the difference between terry and terri : Label the fallacy as a slippery slope, questionable cause, equivocation, etc. It's possible that you may find more than one fallacy. Please explain why you labeled the fallacy/fallacies the way you did. This will require that you briefly summarize..
Journalize the entries to record the summarized operations : Journalize the entries to record the summarized operations. For a compound transaction, if an amount box does not require an entry, leave it blank
Sort the array 15 80 35 25 60 30 into descending order : The above algorithm has a fundamental flaw. As written, how does it change theArray?
State the null hypothesis and the alternate hypothesis : The service time for customers at Stylum Barber Shop follows a normal distribution with a population standard deviation of 2 minutes. At the beginning of the fiscal year, the owner conducted a time study of 25 customers and discovered that the mea..
Calculate a regression line for data : 1. Plot the data.  Does there seem to be a linear relationship between the discount offered and sales on "Big Saturday" events? Yes or No  2. Calculate a regression line for this data (use whole numbers for the percent discount, that is, use 15 f..
What are some of challenges of becoming a critical thinker : What are some of the challenges of becoming a critical thinker in our contemporary world? In what ways do these challenges also make it important to develop critical thinking skills?
Include how unstable money can make an economy : Development of money in the economy and how it is used to create wealth. Include how unstable money can make an economy weaker.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd