1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
LiRa [457]
3 years ago
5

Write a program that implement a bubble sort ?

Computers and Technology
1 answer:
Tanzania [10]3 years ago
6 0

Answer:

 A program that implement a bubble sort:

 #include<iostream.h>

 #include<conio.h>

 

int main()

{

int ar[50],no,i,j,temp;

cout<<"Enter array size ";

cin>>no;

cout<<"Enter array elements ";  

 

for(i=0;i<no;++i)

 cin>>ar[i];

 

for(i=1;i<no;++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<no;++i)

 cout<<" "<<ar[i];

 

return 0;

}

You might be interested in
Can someone help me please
Andreyy89
Your anwser will be the last one
6 0
3 years ago
Read 2 more answers
At the second simple query wizard dialog box, you are asked whether you would like to create a detail or a(n) _____ query.
Alisiya [41]
The correct answer is: Summary

<span>If you only selected fields from a single table in the first screen, then when you click the “Next >” button to continue, you will only need to provide the query with a name and then click the “Finish” button to finish creating the query. If, however, you picked data fields from two or more related tables, then when you click the “Next >” button, you will instead view a second screen which asks if you would like a “Detail” or “Summary” query. You can select the option button for the type of query that you wish to create. If you select “Summary,” then you will be able to click the “Summary Options…” button to open the “Summary Options” dialog box. In this dialog box, you can select what type of summary to perform over a selected field. Make your selections, and then click the “OK” button to return to the “Simple Query Wizard.”</span>

Select summary to show only results of aggregate functions.

Select the aggregate function and the field name of the numeric field in the list box. You can enter as many aggregate functions as you want, one in each row of controls.

Aggregate function

Select the aggregate function.

Field name

Select the numeric field name.

+

Appends a new row of controls.

-

Removes the last row of controls.

3 0
2 years ago
Why is accessing a disk block expensive? discuss the time components involved in accessing a disk block. (?
Dahasolnce [82]

Answer:

Explanation:

A disk block works by transferring data between the disk and main memory units which are called the blocks, whose size can range drastically from 512 bytes to several thousand.  This data is converted to hardware-level cylinder, surface, and sector number  which makes accessing the data immensely slower than accessing data in the main memory. This time constraint is also the main reason as to why accessing a disk block is so expensive.

6 0
3 years ago
A run is a sequence of adjacent repeated values. Write a
Roman55 [17]

Answer: yeet

Explanation:

liker up

6 0
2 years ago
In Python 3, write a decorator function that has the following property:
kicyunya [14]

Answer:

Python code is explained below

Explanation:

# decorator.py starts

def uppercase(fcn):

def wrapper():

original = fcn;

modified = str(fcn).upper() ;

return modified;

return wrapper();

# decorator.py ends

# greet.py starts

import decorator  #to generate the decorator

def greetings():  #invokes the greetings function for output

print("Hello");

print(decorator.uppercase(greetings));

# greet.py ends

8 0
2 years ago
Other questions:
  • The Internet may best be compared to a/an
    8·1 answer
  • A hacker scanning a web server is likely to be identified by the target's web a. Because of the FBI's Carnivore scanning program
    12·1 answer
  • What does expected initializer before ". " token mean?
    7·1 answer
  • Gemima wants to order the different kinds of food alphabetically on the table. Which actions should she take? Check all that app
    8·2 answers
  • Examine the following output:
    11·1 answer
  • Select the correct answer from each drop-down menu
    7·1 answer
  • The celestial sphere is divided into
    14·2 answers
  • Commercials are short media advertising that persuades a consumer to buy/use their product/service?
    13·2 answers
  • When should you create an outline?
    7·1 answer
  • __________ states that network connection speeds for high-end users will increase by 50 percent per year, enabling new companies
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!