Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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#

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions

Question

understand the meaning of the terms discipline and grievance

Answered: 1 week ago