Bucket Sort Problems... Please Help!
What am I doing wrong here?? Am I reading the file in correctly? What if any thing is wrong with the Bucket Sort part? It is supposed to output what the array looks like after each pass and then again after the array is sorted making the minimum # of passes. Also, I am supposed to output what the largest # is and how many digits it is. Thanks again guys!
#include #include #include int main() { ifstream infile ("/u3/svlasnik/values"); const int size = 6; int array[size] = { 0 }; for ( int x = 0; x < size ; x++ ) infile >> array[x]; int *bucketData; *bucketData = array[size - 1]; for(int i = 0; i < array[size - 1]; i++) { bucketData[i] = (rand() % 1000) / 1000.0; for ( int x = 0; x < size ; x++ ) cout << "Look, here's value " << x << ": " << array[x] << endl; } return 0; }