Beispiel #1
0
        public void MergeSort()
        {
            MergeSort merge = new MergeSort();


            //pass in highestValue and DCollection
            merge.sort(DCollection, highestValue);
        }
        //*******************END METHOD TO ADD NEW DROID TO COLLECTION**************//



        //******************METHOD WHICH WILL MERGE SORT DROID COLLECTION BY TOTAL COST******************//
        public void MergeSort()
        {
            MergeSort merge = new MergeSort();         //create new instance of MergeSort class

            merge.sort(droidCollection, highestIndex); //pass in the droid collection, along with the highest index of the array.
        }                                              //without the highestIndex, the sort could break due to possible null values in the array.
        //*******************END METHOD TO ADD NEW DROID TO COLLECTION**************//
        //******************METHOD WHICH WILL MERGE SORT DROID COLLECTION BY TOTAL COST******************//
        public void MergeSort()
        {
            MergeSort merge = new MergeSort();     //create new instance of MergeSort class

            merge.sort(droidCollection, highestIndex);   //pass in the droid collection, along with the highest index of the array.
        }
Beispiel #4
0
        //**********************
        //MergeSort
        //**********************
        public void MergeSort()
        {
            MergeSort merge = new MergeSort();

            merge.sort(droidCollection, lengthOfCollection);
        }
        public void SortbyTotalCost()
        {
            MergeSort mergeSort = new MergeSort();

            Droid[] droids = new Droid[LengthofCollection];

            mergeSort.sort(droids);
        }