Data structure program and Algo in c++.you can get logic
//#include
//#include
//#include
//using namespace std;
//void selection_sort(int arr[], int n)
//{
// int num,temp,moves=0,comp=0;
// clock_t startTime = clock();
// for (int i=0; i < n-1; i++)
// {
// num = i;
//
// for (int j=i+1; j < n; j++)
// {
// comp++;
// if (arr[j] < arr[num])
// num=j;
//
// }
//
// if (num != i)
// { moves++;
// temp = arr[i];
// arr[i] = arr[num];
// arr[num] = temp;
// }
// }
// clock_t endTime = clock();
// double elapse = (double)(endTime - startTime) / CLOCKS_PER_SEC;
// cout << "The operation took " << elapse << " seconds "<<" moves "<> temp;
// arr=new int [temp];
// for(int i=0;i>arr[i];
// }
// selection_sort(arr,temp);
// ofstream fout;
// fout.open("new.txt");
// for(int i=0;i<=temp;i++)
// {
// fout<
Friday, 11 April 2014
Subscribe to:
Posts (Atom)