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, 22.06.2019 11:00
Lisa’s company, abc ltd., lost its biggest client and is now facing a financial crunch. most of her colleagues have resigned, but lisa decides to stay with the company and assist the management in overcoming the financial situation. which quality is lisa demonstrating? a. self-management b. cooperativeness c. responsibility d. loyalty
Answers: 2
question
Computers and Technology, 23.06.2019 04:31
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What are ways to switch windows in excel? check all that apply. on the status bar, click the windows button, and then click the file name. on the task bar, click to display the excel jump list, and then click the file name. on the view tab, in the window group, click switch windows, and then click the file name. on the review tab, in the viewing group, click files, and then click the file name.
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
You know the right answer?
In many computer applications that process any kind of numbers, sorting numbers in either ascending...
Questions
question
Physics, 05.10.2019 03:00
question
Mathematics, 05.10.2019 03:00
Questions on the website: 13722367