Express the shaker sort in pseudo code

Assignment Help Basic Computer Science
Reference no: EM131452900

The shaker sort (or bidirectional bubble sort) successively compares pairs of adjacent elements, exchanging them if they are out of order, and alternately passing through the list from the beginning to the end and then from the end to the beginning until no exchanges are needed

1. Show the steps used by the shaker sort to sort the list 3, 5, 1, 4, 6, 2.

2. Express the shaker sort in pseudo code.

3. Show that the shaker sort has O(n2complexity measured in terms of the number of comparisons it uses.

4. Explain why the shaker sort is efficient for sorting lists that are already in close to the correct order.

5. Show that (n log n2)3 is O(n6).

6. Show that 8x3+ 12+ 100 log is O(x3).

7. Give a big-estimate for (x2 + x(log x)3· (2xx3).

Reference no: EM131452900

Questions Cloud

Argue for or against the limitation of speed limits : PSCI 2231 : Write a composition using one of the topics listed below. Your composition needs to be three to five paragraphs long.
Method for making wise decisions in the face of uncertainty : Comment on the statement bringing out clearly how does statistics help in business decision-making.
What is the utilization during peak hours : An AS/RS is used for work-in-process storage in a manufacturing facility. The AS/RS has five aisles, each aisle being 120 ft long and 40 ft high.
Describe concepts as if you were explaining them to a friend : Describe the concepts as if you were explaining them to a friend. How will you use the concepts in the class or in your personal or professional life?
Express the shaker sort in pseudo code : 1. Show the steps used by the shaker sort to sort the list 3, 5, 1, 4, 6, 2. 2. Express the shaker sort in pseudo code.
Discuss the guidelines for safe materials handling : Discuss at least five of the barriers and challenges to employee involvement in safety efforts. Discuss the guidelines for safe materials handling.
Determine acceleration and deceleration : An AS/RS with one aisle is 300 ft long and 60 ft high. The S/R machine has a maximum speed of 300 ft/min in the horizontal direction.
Provide a theoretical analysis : provide a theoretical analysis. In this analysis, you can focus on either the rule-breakers or the rule-makers.
What other problems with msdss are likely to remain despite : With the adoption of GHS by OSHA, the problems associated. What other problems with MSDSs are likely to remain despite the standardized formatting?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What would the chromaticity diagram look like

Suppose instead that the domains overlapped so that red was defined on [500, 600], green on [450, 550], and blue on [400, 500]. What would the chromaticity diagram look like? How many primaries would be needed to faithfully reproduce every color p..

  Digitized while satisfying nyquist criterion

What is max uncertainty for 6v signal? what is max uncertainty of for 18 bit  ADC ? Max uncertainty for 30bit ADC? If this ADC has a conversion time of 62 microsec, what is the highest frequency can be accurately digitized while satisfying nyquist..

  Compute the probability of events

Imagine that such a die is rolled twice in succession and that the face values of the two rolls are added together. This sum is recorded as the outcome of a single trial of a random experiment. Compute the probability of each of the following even..

  Difference between recursive queries and iterative queries

1. What is the difference between recursive queries and iterative queries of DNS servers, in terms of the DNS performance (discuss this in terms of the number of messages needed and the corresponding delay)?

  What is the unit of data working in the data link layer

What is the unit of data working in the Data Link layer?

  You will be designing an on campus internetwork for new larg

You will be designing an on-campus internetwork for new large university that has been proposed. The University will have dozens of buildings, all within a very close proximity to each other. Use the University of California, Berkeley Campus as a mod..

  Calculate and display the total rainfall for the year

Rainfall Statistics Modification Modify the Rainfall Statistics program you wrote for Programming Challenge 2 of Chapter 7. The program should display a list of months, sorted in order of rainfall, from highest to lowest.

  Draw a constellation pattern for a modem

Draw a constellation pattern for a modem that uses eight equally spaced phase angles and four equally spaced amplitude levels. If the modem operates at 4800 baud, what is the bit rate?

  Difference between a op-amp buffer and a normal wire

Signal processing: What is the difference between a op-amp buffer and a normal wire? Can we treat them like they can replace each other?

  What is its effect on the impulse response

Which FIR system representation is used in the frequency-sampling form and why does it lead to a parallel structure?

  Difference between a local variable and an instance variable

Explain the purpose of a method parameter. What is the difference between a parameter and an argument?

  Budgeted cost of work performed

Note: BCWS (budgeted cost of work scheduled), BCWP (budgeted cost of work performed), ACWP (actual cost of work performed), SV (schedule variance), CV (cost variance), EAC (estimate at completion), BAC (budget at completion; baseline cost), CPI (c..

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