subject

In many computer applications that process any kind of numbers, sorting numbers in either ascending or descending order is an essential function. One of the earliest and easiest techniques to sort numbers is bubble sort. The bubble sort algorithm gets its name from the fact that individual numbers in the array being sorted are bubbled to the top of the list as the sort progresses. The rules for bubble sorting are as follows: Ascending Sort:
1. Test only two numbers at a time, starting with the first two numbers.
2. If the top number is smaller, leave as is. If the top number is larger, switch the two numbers in the array.
3. Go down one number and compare that number to the number that follows it. These two will be a new pair.
4. Continue this process until no switch has been made in an entire pass through the list. Descending Sort: All steps are the same as ascending sort except for Step #2. 2 If the top number is larger, leave as is. If the top number is smaller, switch the two numbers, Your job is to write a program that takes 10 integers in no particular order and sort them in both ascending and descending order. The program output should display 3 lists of the numbers, unsorted, in ascending order, and in descending order. Your program should generate 10 random numbers in between 1 and 100 for sorting.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
1. which of the following is a search engine? a) mozilla firefox b)internet explorer c)google d)safari 2. which of the following statements is true? a) all search engines will provide the same results when you enter the same query. b) all search engines use the same amount of advertisements. c) some search engines are also browsers. d) search engines often provide different results, even when you enter the same query.
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
As with any small island country, cuba has fewer natural resources than countries such as brazil. this affects their economy in that cuba a) exports only manufactured products. b) exports more products than it imports.. c) must import more products than it exports. d) has imposed trade barriers against the united states.
Answers: 3
question
Computers and Technology, 23.06.2019 07:00
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
question
Computers and Technology, 23.06.2019 10:50
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
You know the right answer?
In many computer applications that process any kind of numbers, sorting numbers in either ascending...
Questions
question
Mathematics, 13.10.2020 17:01
question
Mathematics, 13.10.2020 17:01
question
Mathematics, 13.10.2020 17:01
question
Mathematics, 13.10.2020 17:01