You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import java.io.*; import java.util.*; public class bubblesort { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.print("Enter the number of elements to sort: "); int n = scan.nextInt(); int[] a; a = new int[n]; System.out.println("Enter the elements to sort "); int i = 0; for(i=0;i<n;i++) { a[i] = scan.nextInt(); } System.out.println("Elements after bubble sort "); int j = 0; for(i=0;i<n-1;i++)