Question: C# 5.4 Sorting Bubble Sort for N items loop N times loop from 0 up to N-1 Computers spend a lot of time sorting things

C#

C# 5.4 Sorting Bubble Sort for N items loop N times loop

5.4 Sorting Bubble Sort for N items loop N times loop from 0 up to N-1 Computers spend a lot of time sorting things into order and there are many different sorting algorithms to choose from. One of the simplest (and slowest) is called the Bubble Sort, It has one loop contained inside another loop as shown here if current item > next item swap the two items end if end loop Your Tasks end loop Create a new project for this task with a class called Bubble Add a new method called inputNumbers() which inputs 6 numbers into an array Add a second method called display() which clears the screen and displays all the numbers one above the other Make sure the program works correctly so far Now add a third method called sortNumbers() which applies the Bubble Sort algorithm to sort the numbers into numerical order 1. 2. 3. nd 4. 5. 6. Call the methods in the right order and get the sorting to work. 7. Try it for 20 numbers 8. Add 3 more methods to apply a similar technique to sorting a list of names into alphabetical order

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!