Professional Documents
Culture Documents
Bubble Sort PDF
Bubble Sort PDF
Bubble Sort PDF
import java.io.*;
1. public class Ascending _Order
2. {
3.
4.
5.
int n, temp;
6.
7.
8.
n =Integer.parseInt(ak.readLine());
9.
10.
11.
12.
13.
a[i] = s.nextInt();
14.
15.
16.
17.
18.
19.
20.
21.
temp = a[i];
22.
a[i] = a[j];
23.
a[j] = temp;
24.
25.
26.
27.
System.out.print("Ascending Order:");
28.
29.
30.
System.out.print(a[i] + ",");
31.
32.
System.out.print(a[n - 1]);
33.
34. }