Question: I need Pseudo Code/Algorithm and UML diagram for this code please i need it ASAP please this is for JAVA class SortandSwapCount.java X import java.util.Random;

 I need Pseudo Code/Algorithm and UML diagram for this code please
i need it ASAP please this is for JAVA class SortandSwapCount.java X
import java.util.Random; public class SortandSwapCount | public static void main(String[] args) {
V/Generate random array for test and copy that into 3 arrays int[]
arrl=new int [20]; int[] arr2=new int [20]; int[] arr3new int [20]; int[]I need Pseudo Code/Algorithm and UML diagram for this code please
i need it ASAP please
this is for JAVA class

SortandSwapCount.java X import java.util.Random; public class SortandSwapCount | public static void main(String[] args) { V/Generate random array for test and copy that into 3 arrays int[] arrl=new int [20]; int[] arr2=new int [20]; int[] arr3new int [20]; int[] arr4=new int[20]; Random rand = new Random(); for (int i = 0; i = 0 & arrij temp) arrlj + 1) = arr(s); 1/Increment swap count swapCnt++; j -j - 1; arrij + 1] = temp: //Return swap count return swapant; } //Bubble sort implementation public static int bubbleSort (int[] arr) int swapCnt=0; 7/Comparison loop for (int i = 0; i arr[j+1]) //Swap and increment swap count int temp = arr[j]; arr[j] = arr[j+1]; arr[j+1) = temp: swapCnt++; return swapCnt: 1 //Mergesort implementation public static int mergeSort(int[] arr, int start, int end) File Edit Search View Tools Macros Configure Window Help Find incrementally I A SortandSwapCount.java X // Mergesort implementation public static int merge Sort (int[] arr, int start, int end) int mid, swapCnt=0; if (startcend) mid = (starttend)/2; swapCnt= merge Sort (arr, start, mid); swapCnt-mergesort (arr, mid+1, end); swapCnt+merge arr, start, mid, end); return swapCnt; /Merge 2 parts of the array public static int merge (int arr], int start, int mid, int end) int i=start, j-mid+1, k, index - start, swapCnt=0; int[] temp=new int(arr.length); while(icmid &6 jmid) while (jc-end) temp[index] = arrij: index++; j++; swapent++; 30 1 Find incrementally Ra SortandSwap Countjava X else 1 while(i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!