SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 314 Weeks Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 14 Dec 2017 My Price 10.00

original array and the subarrays that are created are accessed

it is a java program, please help me complete it.......

  •     /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // Show a sample random array does get sorted by merge sort
            SortableQueue Q = new SortableQueue(10);
            out.println("Before merge sorting");
            out.println(Q);
            mergeSort(Q);
            out.println("After merge sorting");
            out.println(Q);

            // Show a sample random array does get sorted by selection sort
            Q = new SortableQueue(10);
            out.println("Before selection sorting");
            out.println(Q);
            Q = selectSort(Q);
            out.println("After selection sorting");
            out.println(Q);

            // TODO: Add code to collect and display timing data
            // for queues of various sizes using merge sort
        // and using selection sort

        } // end main
       
        static void mergeSort(SortableQueue Q) {
    //        out.println("sorting: " + Q);
            if (!Q.isSorted()) {
                SortableQueue Q1 = new SortableQueue(), Q2 = new SortableQueue();
                Q.split(Q1, Q2);
    //            out.println("first split: " + Q1);
    //            out.println("second split: " + Q2);
                mergeSort(Q1);
                mergeSort(Q2);
    //            out.println("Merging " + Q1 + " and " + Q2);
                Q.merge(Q1, Q2);
    //            out.println("After merge: " + Q);
            } // end if
        } // end mergeSort

        static SortableQueue selectSort(SortableQueue Q) {
        // declare a new Sortable queue Q2
            SortableQueue Q2 = new SortableQueue();
       
        // repeatedly remove the minimum from Q and add that value to Q2 until Q is empty

            return Q2;
        } // end selectSort

Attachments:

Answers

(5)
Status NEW Posted 14 Dec 2017 01:12 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)