Lexicographical String Sorting
807607Jan 19 2007 — edited Jan 19 2007I would like to know your opinion on what would be the best way to do the following homework question.
Exercise P5.10. Write a program that reads in four strings and prints the lexicographically smallest and largest one:
Enter four strings:
Charlie
Able
Delta
Baker
The lexicographic minimum is Able
The lexicographic maximum is Delta
Hint: Use a class that keeps track of the current maximum and minimum.