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 09:00
Meenu wants to create a high quality drawing in a variety of colours. which device should she use for the same?
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Which location-sharing service offers items for users as a gaming component and also allows them to collectively link their check-ins to publish a trip? a. whrrl b. buzzd c. foursquare (this option is wrong i already tried) d. gowalla for plato
Answers: 2
question
Computers and Technology, 22.06.2019 20:40
Assume that there is a 4% rate of disk drive failure in a year. a. if all your computer data is stored on a hard disk drive with a copy stored on a second hard disk drive, what is the probability that during a year, you can avoid catastrophe with at least one working drive? b. if copies of all your computer data are stored on three independent hard disk drives, what is the probability that during a year, you can avoid catastrophe with at least one working drive?
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Which of the following terms refers to a collection of different types of software that share the goal of infiltrating a computer and making it do something? a- malware b- virus c- spyware d- trojan horse
Answers: 2
You know the right answer?
In many computer applications that process any kind of numbers, sorting numbers in either ascending...
Questions
Questions on the website: 13722359