Question: Starter code is provided. Finish it so that the final program will repeat the following steps: - read a file name, - open that file

Starter code is provided. Finish it so that the final program will repeat the following steps: - read a file name, - open that file and read the data from it into an array of int, - run bucket sort on that array to sort it. It will print the original array, intermediate information while running bucket sort and the sorted array. - ask the user if they want to continue. This is already implemented. Einclude cstdlib, hs * include sstdio.hp *include smath. ho clude "list.h" // useful 1f you want to use functions from list.c void print array ( int arr [] , int N); vold rune(); f 11 function to insert a new node in a sorted list. E.g.: nodePT insert_sorted(nodePT L, nodePT newP); l/or nodePT insert_sorted(nodePT L, int elem); +i f= (l function to sort an array sing bucket sort: vold bucket_sort(int * arr. int N); * f void print_array(int arr [], int N) \{ Int ji printf( " array: "); for (j= i j di ;j++)t printe("4.1d,", arr [j]); 3 3 1f 1nt main() printf("This progran will read a file nane, load data for an array frea there and print the sorted array-ln"); printf(" The array is sorted using bucket sort. 1nin); printf("This will be repeated as long as the user mants. (n) if int optiont do 1 runt(); printf(" InDo you want to repeat? Enter 1 to repeat, or to stop) =1) char ch: scenf("hdhe", coption, sch); // ch is used to renove the Enter-fron the input buffer ) while (option =1 it return es
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
