Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Lexicographical String Sorting

807607Jan 19 2007 — edited Jan 19 2007
I 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2007
Added on Jan 19 2007
17 comments
1,853 views