Homework Assignment V

Reading: Astrachan pages 489-508
Ford & Topp pages 779-798

1(7 points) Sort the array
74162385
using Bubble Sort . Show the results after each pass in the table below. Explain, briefly, what happened next to each row.

01234567index     
74162385original array           
          
          
          
          
          
          
          

2(7 points) Sort the array
74162385
using Insertion Sort . Show the results after each pass in the table below. Explain, briefly, what happened next to each row.

01234567index     
74162385original array           
          
          
          
          
          
          
          

3(7 points) Sort the array
74162385
using Selection Sort .
Show the results after each pass in the table below. Explain, briefly, what happened next to each row.

01234567index     
74162385original array           
          
          
          
          
          
          
          

4(8 points) Sort the array
74162385
using Quick Sort .
Select the pivot from the midpoint in the list. For each pass, show the results after each pass in the table below and indicate (on the right) all exchanges that move a corresponding pair of elements in the lower and upper sublist.

01234567index     
74162385original array           
          
          
          
          
          
          
          


Last Updated: April 22, 1997 8:24 pm by

Harriet Fell
College of Computer Science, Northeastern University
360 Huntington Avenue #161CN,
Boston, MA 02115
Internet: fell@ccs.neu.edu
Phone: (617) 373-2198 / Fax: (617) 373-5121
The URL for this document is: http://www.ccs.neu.edu/home/fell/COM1101/HW/HW5/hw5.html