Without looking at the book, write a program to sort the elements of an array. Develop an algorithm first. Feel free to use as many operations or as much storage as you need to implement your algorithm. Be creative!
Once you have the sort working, parameterize your program so that the user can easily change the order of the sort from ascending to descending and vice versa. Can you come up with a solution other than a simple if-else?