Question
Write SortSearch class that contains the following methods: selectionSortA(int [] A) : Sort the array A into increasing order using selection sort algorithm. selectionSortD(int []
Write SortSearch class that contains the following methods:
selectionSortA(int [] A) : Sort the array A into increasing order using selection sort algorithm. selectionSortD(int [] A) : Sort the array A into decreasing order using selection sort algorithm. insertionSortA(int [] A) : Sort the array A into increasing order using insertion sort algorithm insertionSortD(int [] A) : Sort the array A into decreasing order using insertion sort algorithm BubbleSort(int [] A) : Sort the array A into increasing order using bubble sort algorithm. The bubble sort algorithm is comparison-based algorithm in which each pair of adjacent elements is compared and the elements are swapped if they are not in order. While the array is not sorted For each adjacent pair of elements If the pair is not sorted Swap its elements . String[] sortArrayOfStrings(String[] array) : Sort the array array into increasing order using the insertion sort algorithm. shuffle(int [] A) : Rearrange the items in the array A into a random order. Putting the elements of an array into a random order is much less common problem, but is a bit more fun. The typical case of this problem is shuffling a deck of cards. A good algorithm for shuffling is similar to selection sort, except that instead of moving the biggest item to the end of the list, an item is selected at random and moved to the end of the list. int find(int[] A, int N) : Search the array A for the integer N . If N is not in the array, then -1 is returned. If N is in the array, then the return value is the first integer i that satisfies A[i] == N . int binarySearch(int[] A, int N) : Search the array A for the integer N . A must be sorted into increasing order. If N is in the array, then the return value, i . If N is not in the array, then the return value is -1 . Write a client class to test all your methods. In Java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started