Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Algorithm Development Discussion

Part 1: Sorting Methods

Sorts are used every day in many applications.

• Discuss when you would use a sort and what kind of sort you would use for a given situation.
• Reply to others with support for or arguments against their proposal of sort usage and implementation.

Part 2: Respond to two peer posts

Peer 1 David

There are several types of sorting algorithms. I have used many of them over the years. A good example is to think about a binary search. For a binary search to work the array or list must be sorted. If you are given an unsorted list or if you are not sure if the list is sorted or not, a sorting algorithm is needed. Which sorting algorithm to use in this situation is mainly up to you. You should use a merge sort or insertion sort because of their speed but a bubble sort or selection sort still work. Bubble sort is one of the slowest sorting algorithms but it is the easiest one to code. It can be done with two for loops whereas the other sorting algorithms are more complex but are faster.

Peer 2 Toni

Quick sort: would be used when you don't need a stable sort and average case performance matters more than worst case performance. A quick sort is O(N log N) on average, O(N^2) in the worst case.

Merge sort: is used when you need a stable, O(N log N) sort, this is about your only option. The only downsides to it are that it uses O(N) auxiliary space and has a slightly larger constant than a quick sort.

Heap sort: is used when you don't need a stable sort and you care more about worst case performance than average case performance. It's guaranteed to be O(N log N), and uses O(1) auxiliary space.

Introsort: This is a quick sort that switches to a heap sort after a certain recursion depth to get around quick sort's O(N^2) worst case. It's almost always better than a plain old quick sort.

Insertion sort: When N is guaranteed to be small, including as the base case of a quick sort or merge sort. While this is O(N^2), it has a very small constant and is a stable sort.

Bubble sort, selection sort: When you're doing something quick and dirty and for some reason you can't just use the standard library's sorting algorithm.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92251373
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Penetration testing is a technique used to identify

Penetration testing is a technique used to identify security weaknesses in your network. Discuss a type of penetration testing and the different methods utilized to recognize vulnerabilities in your network.

Systems analysis project 5can you answer the 4questions

Systems Analysis project 5: Can you answer the 4questions please. Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an internat ...

How does the learning environment effect the success of

How does the learning environment effect the success of students? Provide examples.

This is a simple exercise to introduce the use of arrays

This is a simple exercise to introduce the use of arrays and some of the common errors that occur when programming with them in c++. • Write a simple program that allows the user to enter 10 integers into an array, then ...

Question discussion pointdefine and briefly discuss the

Question: Discussion point: Define and briefly discuss the following brainstorming techniques, the delphi technique, brainstorming, or nominal group technique. Please read the above discussion point and write the respons ...

There are two firms that produce large commercial airplanes

There are two firms that produce large commercial airplanes, namely, Boeing and Airbus. Boeing and Airbus have different flight control systems, with many pilots preferring one system over the other. The Airbus A380 has ...

What steps are required in determining the big-oh notation

What steps are required in determining the Big-Oh notation for the algorithm when sorting an array of integers 5 7 4 9 8 5 6 3 and showing the contents each time a selection sort changes it while sorting the array into a ...

A 200g sample of acetylsalicylic acid better known

A 2.00g sample of acetylsalicylic acid, better known asaspirin, is dissolved in 100mL of water and titrated with 0.200mol/L NaOH(aq) to the end point. The volume of base required is 55.5mL. Calculate the molar mass of ac ...

Systems analysis and design projectpersonal trainer inc

Systems Analysis and design project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a n ...

Design a moore machine where the output y goes high 1 when

Design a Moore machine where the output Y goes high (=1) when the last four bits of the input X were 1110: 4th to last bit seen = 1 3rd to last bit seen = 1 2nd to last bit seen = 1 Last bit seen = 0 Your machine must be ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As