Sign In
Ask Question
Computers & Technology
Guest
25 December, 14:50
Write a program that implement a bubble sort?
+1
Answers (
1
)
Parker Tyler
25 December, 18:10
0
A program that implement a bubble sort:
#include
#include
int main ()
{
int ar[50], no, i, j, temp;
cout<<"Enter array size ";
cin>>no;
cout<<"Enter array elements ";
for (i=0; i
cin>>ar[i];
for (i=1; i
{
for (j=0; j< (no-i); ++j)
if (ar[j]>ar[j+1])
{
temp=ar[j];
ar[j]=ar[j+1];
ar[j+1]=temp;
}
}
cout<<"Bubble Sort array";
for (i=0; i
cout<<" "<
return 0;
}
Comment
Complaint
Link
Know the Answer?
Answer
Not Sure About the Answer?
Get an answer to your question ✅
“Write a program that implement a bubble sort? ...”
in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers
You Might be Interested in
Write a method swaparrayends () that swaps the first and last elements of its array parameter. ex: sortarray = {10, 20, 30, 40} becomes {40, 20, 30, 10}. the array's size may differ from 4.
Answers (1)
What data does Bittorrenting uses? Explain.
Answers (1)
Write a method body for the static method isDivisibleBy5 shown below. The only NaturalNumber methods you are allowed to use are the kernel methods multiplyBy10, divideBy10, and isZero.
Answers (1)
Explain digital divide
Answers (1)
How did we discover what an atom looks like?
Answers (1)
New Questions in Computers & Technology
Which command is used to find the number of words, characters, paragraphs, or lines in a Microsoft Word Document?
Answers (1)
Bob has been assigned to set up a digital certificate solution for use with e-mail. One of the requirements he has been given is to ensure that the solution provides for third-party authentication. Which of the following should he choose PGP X.
Answers (1)
according to the National Automobile Dealers Association, a single dealership may employ people with as many as 57 different A. job titles. B. technicians. C. salaries. D. specialists
Answers (1)
Which page feature is used in long documents to assist readers in quickly finding information in the document without having to turn through all the pages? bibliography cover page index none of the above
Answers (2)
How do diferent types of software work together? Check all that apply Application software is the middleman between the user and the OS. The OS translates application software instructions into a language the BIOS understands.
Answers (1)
Home
»
Computers & Technology
» Write a program that implement a bubble sort?
Sign In
Sign Up
Forgot Password?