Question: Java only please I need help figuring out how to write code so that it is using selection sort and not bubble sort 7 import
Java only please
I need help figuring out how to write code so that it is using selection sort and not bubble sort
7 import java.text.SimpleDateFormat; 8 import java.util.Calendar; 9 import java.util.Date; 10 import java.util.Random; 11 import java.util.Scanner; 12 import java.util.concurrent.TimeUnit; 13 //class definition 14 public class BubbleSortTech { 15 //variable declaration 16 long runtime=0; 17 Calendar cal1,cal2; 18 SimpleDateFormat sdf; 19 int arr[]; 20 Random rand; 21 //constructor 22 public BubbleSortTech(int n) { 23 sdf = new SimpleDateFormat("HH:mm:ss"); 24 rand=new Random(); 25 arr=new int[n]; 26 //getting time before completion 27 cal1 = Calendar.getInstance(); 28 Date start_time= cal1.getTime(); 29 for(int j=1;j<1000;j++){ 30 for(int i=0;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
