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, 24.06.2019 17:50
You will subnet the network address 172.31.103.0/24. the network has the following requirements: · room-114 lan will require 27 host ip addresses · room-279 lan will require 25 host ip addresses · room-312 lan will require 14 host ip addresses · room-407 lan will require 8 host ip addresses how many subnets are needed in the network topology?
Answers: 2
question
Computers and Technology, 24.06.2019 22:00
What is a number system, and what is the total number of digits used in this system called? a number system is a system that uses different (options: a) numbers b) symbols c) codes d) digits e) alphabets) to represent different numbers. the total number of digits used in a number system is known as its (options: 1) processor 2) converter 3) radix 4) least significant digit 5) most significant digit)
Answers: 1
question
Computers and Technology, 25.06.2019 05:00
Carmina works at a fast-food restaurant. during the slow afternoon hours, carmina always find projects to keep her busy, like washing all the trays or deep-cleaning the drive-thru area. what workplace habit does carmina show by doing this? efficiency initiative interpersonal skills problem solving
Answers: 1
question
Computers and Technology, 25.06.2019 08:20
E-commerce builds on traditional commerce by adding the flexibility that networks offer and the availability of the internet. - true or false
Answers: 1
You know the right answer?
In many computer applications that process any kind of numbers, sorting numbers in either ascending...
Questions
question
Mathematics, 30.01.2020 19:44
question
Spanish, 30.01.2020 19:44
Questions on the website: 13722367