Explore BrainMass

Explore BrainMass

    Creating a Recursive Java Program That Sorts Objects

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    I need to implement a class 'SearchSort' which contains recursive versions of the methods below:

    static void selectionSort(Comparable[] list)
    static boolean binarySearch(Comparable[] list, Comparable target) // true if target in list

    The signatures of the method like the ones above.
    The class (SearchSort) must also have the method 'static boolean isSorted(Comparable[] list)' that returns true if (and only if) the enclosed list is sorted (smallest item first).

    Another program 'SearchSortMain' shows and tests the different methods.

    Enclosed please find an example of names and telephone numbers that can be used for sorting.

    © BrainMass Inc. brainmass.com October 10, 2019, 2:10 am ad1c9bdddf


    Solution Preview

    Please see attached files - "SearchSort.java", "SearchSortMain.java".

    The file "SearchSort.java" ...

    Solution Summary

    Provides steps necessary to create a recursive Java program that sorts objects.