CMSC 106 HOMEWORK ASSIGNMENT #3

DUE: January 14, 1998 (start of class)

  1. Design and code a program which implements the quicksort algorithm. The quicksort algorithm is a recursive procedure which sorts an array of integers into least to greatest order.
          quicksort (a:array,top:int,bot:int)
              if top-bot gt 1 
                then 
    	        find pivot
    		put elements in small-pivot-large arrangment
                    quicksort(a,top,pivot-1)
                    quicksort(a,pivot+1,bot)
    
    
    
    
  2. Document the code. Comments should be brief but informative. A good rule of thumb is a comment for each function. Also a header comment with your name, social security number, the assignment number, a general description of the program and the names of any files in your account needed to execute the program.

  3. Execute the code (at least twice) using the "script" command to retain the runs.

  4. Hand in a print-out of the documented code along with the runs.