Question: JAVA Program: Write a Java Program that implements these methods (see below). Requirements: 1. Write/ Implements Methods 1.1 Generic Binary Search public static int binarySearch(E
JAVA Program: Write a Java Program that implements these methods (see below).
Requirements:
1. Write/ Implements Methods
1.1 Generic Binary Search
public static
1.2 Shuffle ArrayList *Hint: Make use of random numbers
public static
1.3 Sort ArrayList
public static
2. Write main method and call the methods with various data types.
3. Create a main method that creates data (hard code arrays and ArrayLists) and calls each method three different ways (meaning different types of data) and prints out what the method returns.
For example in 1.1 you might call it with an Integer array and a Character array like this:
Integer[] ints = {1,2,3,4,5,6,18,30};
System.out.print(binarySearch(ints, 18));
// returns 6, print it out using println BinarySearch for 18 returns position 6
Character[] chars = {a, d, m};
System.out.print(binarySearch(chars, m));
// returns 6, print it out using println BinarySearch for m returns position 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
