Task 2 Write A Java Program Anytypemergesort Java To Implement The Merge Sort Algorithm To Sort The Array Containi 1 (29.13 KiB) Viewed 35 times
Task - 2: Write a java program (AnyTypeMergeSort. java) to implement the Merge Sort algorithm to sort the array containing any type of elements (suppose strings). Your program will have the following method signature: - public void mergeSort(T[] A, int lowerBound, int upperBound) - public void merge(T]A, int lowerBound, int midPoint, int upperBound) [Hint: use Comparable interface from java library and override the CompareTo method to compare two objects. Read some stuff about Comparable interface here. https://docs.oracle.com/iavase/8/docs/a ... rable.html]
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!