You are here:

C++/C lang radix doubly link list


i have this case in a double link list, i have to sort the student numbers accordingly. i need to use the radix sort, but i can't generate a code that would radixacally sort the data at the same time save the sorted data in an external file name. e.g. i have to have an output of studinfo.txt containing the sorted data.

please please i need help..
thanks a lot!!

Dear Cathy !

Sure this will be the standard way that every operating systems available today used to handle the data with .( ie swapping from main memory to files and vice versa for manipulation )

Firstly device a class ( structure if its a C++ program ) , Feeding data to your program will be any one of the following two methods
1. Input from Keyboard.
Read input from the keyboard directly to the list or an object.If input is given to an object , just copy the contents into the node , repeat this process until the input exhaust
Now the list is loaded with whole or a part of input data
Sort out the data's in the list using your own sorting method ( in this case radix sort )
Once if the list is sorted then traverse the list from any direction and copy the data's from the node to an object ( Need not to use a new object you can use the same what you have used before to feed input) , that after copying the data's then write the contents of the object into a file.

2.Feeding input from file.
This case also follows the same procedure , instead of reading input from the keyboard , this method reads input from the input file and process the data's and writes the output in an output file.

*reading and writing operation over a file is almost alike

Let you develop the code using this ideas , feel free to call me back if you stuck with your code

Thanks and Regards
Prince M. Premnath  


All Answers

Answers by Expert:

Ask Experts


Prince M. Premnath


Years of research in C/C++ Will bring you all facts regarding , OOPS , SVGA , MOUSE , BIOS , IVT , Feel free to query me :-)


More than 5 years


©2017 All rights reserved.