//------------------------------------------------------------------------------ LagrangeInterpolator& LagrangeInterpolator::operator=(const LagrangeInterpolator &li) { if (&li == this) return *this; CleanupArrays(); CopyArrays(li); order = li.order; actualSize = li.actualSize; beginIndex = li.beginIndex; endIndex = li.endIndex; dataIndex = li.dataIndex; startPoint = li.startPoint; lastX = li.lastX; return *this; }
int main() { //Do something int desArray[size];//Our Descending numbers to sort int myArray[size];//Array for working with stuff char choice = '0'; while (choice != '1'){ UserMenu(&choice); switch(choice){ case '2': PopulateArrayDes(myArray);break; case '3': CopyArrays(desArray,myArray);break; case '4': DisplayArray10Items(myArray);break; case '5': ShellSortAsc(myArray);break; case '6': ShellSortAsc(myArray);break; case '7': CalculateTimeSS(myArray);break; case '8': CalculateTimeSS(myArray);break; }//switch }//while ExitProg(); return 0; }
int main ( void ) { char cSystem = '0'; int Array1[ 10000 ], Array2[ 10000 ]; printf ( "Welcome to CS460 HW 09 solution!\n" ); for ( cSystem = UserMenu ( &cSystem ); cSystem - 48; cSystem = UserMenu ( &cSystem ) ) { switch ( cSystem - 48 ) { case 1: PopulateArray ( Array1 );//populate array break; case 2: CopyArrays ( Array1, Array2 );//copy array break; case 3: printf ( "Array 1:\n" ); DisplayArray ( Array1 );//display array1 printf ( "\nArray 2:\n" ); DisplayArray ( Array2 );//display array2 printf ( "\n" ); break; case 4: CalculateTime ( Array1 );//calculate bubble sort time break; case 5: printf ( "Quick sort time is %lf\n", QsortTime );//print QsortTime break; } } Exit (); return 0; }