Sorting linked lists of strings.
Write a C++ program that reads a lot of words from a text
file, stores them in a linked list of strings, the sorts
that linked list (in ascending order).
You choose which sorting algorithm to use.
I recommend you make your program check its own results.
It is very easy to write a function that runs through a
linked list checking that all the items really are in the
right order. That will make testing much easier.
There are quite a few large text files
on rabbit, here.
If you don't quite remember how to read words from files,
here is a little sample. It also shows you how to get input
from the command line so that there is no annoying user
interaction. If you don't like that, just leave out all
the stuff about argc and argv, and replace argv[1] with
the file name.
Beware: the ifstream constructor doesn't understand about
real C++ strings. If your filename is stored in a string
variable called S, you have to write
ifstream fin(s.c_str());