Table of Contents

Sorting: Implementing an Existing Sort

Criteria

Write a program that does the following:

Assumptions

You may develop the program with the following assumptions in mind:

Example Output

You resulting program should operate in a manner similar to the following (output doesn't have to exactly match):

lab46:~/src/discrete/p07$ ./sortprog

   -============-
[[[ Sort Program ]]]
   -============-

   1>Enter values
   2>Naively Sort
   3>SelectedSort
   4>Display List
   5>Quit for now

] 1

Enter a unique value (-1 to quit): 37
Enter a unique value (-1 to quit): 73
Enter a unique value (-1 to quit): 57
Enter a unique value (-1 to quit): 75
Enter a unique value (-1 to quit): 73
Enter a unique value (-1 to quit): 4
Enter a unique value (-1 to quit): 32
Enter a unique value (-1 to quit): 1
Enter a unique value (-1 to quit): -1

   -============-
[[[ Sort Program ]]]
   -============-

   1>Enter values
   2>Naively Sort
   3>SelectedSort
   4>Display List
   5>Quit for now

] 4
Displaying current list:
    37, 73, 57, 75, 73, 4, 32, 1
    
   -============-
[[[ Sort Program ]]]
   -============-

   1>Enter values
   2>Naively Sort
   3>SelectedSort
   4>Display List
   5>Quit for now

] 3
List Sorted! Process took 4204 mS.

   -============-
[[[ Sort Program ]]]
   -============-

   1>Enter values
   2>Naively Sort
   3>SelectedSort
   4>Display List
   5>Quit for now

] 4
Displaying current list:
    1, 4, 32, 37, 57, 73, 73, 75
  

   -============-
[[[ Sort Program ]]]
   -============-

   1>Enter values
   2>Naively Sort
   3>SelectedSort
   4>Display List
   5>Quit for now

] 5  
lab46:~/src/discrete/p07$ 

Submission

I will be evaluating your program one-on-one at the start of class, when this is due. If you do not show up, you will not receive credit any for it.

Please be sure your program also meets the following criteria: