Data Structures - Lab 04

Tuesday, Sept. 15th

Big-Oh Analysis of Sorting Algorithms


Do not begin this lab until you receive directions from the instructor!

This lab will operate in much the same manner as last week's lab.  I will ask you to do a fair amount of analysis of provided code, answer reflective questions BEFORE you execute code, and then, finally, execute some code to see what happens.

As with last week, I STRONGLY encourage you to work with a partner.


Activity Set A - insertionSort()


 

Situation ... aList
Start  [3, 1, 4, 6, 2, 5]
   
   
   
   
   
   
   
   
   
   
   
   
   

 

 

 

 

 

 

 

 

 

 


Activity Set B - selectionSort()



 

Situation ... aList
Start  [3, 1, 4, 6, 2, 5]
   
   
   
   
   
   
   
   
   
   
   
   
   

 

 

 

 

 

 

 


Activity Set C - bubbleSort()



 

Situation ... aList
Start  [3, 1, 4, 6, 2, 5]
   
   
   
   
   
   
   
   
   
   
   
   
   

 

 

 

 

 

 

 


Activity Set D - shortBubbleSort()



 

 

 

 

 

 


Activity Set E - mergeSort()




 

 

 

 

 

 

 

 


Wrap Up


Ongoing Data Analysis

As you completed this lab you were occasionally instructed to run some tests with different data and record the results here.  Do not complete the fields in this table until instructed to do so.

You will also use this completed table to answer wrap up questions.

 unorderedListorderedListreversedListrandomList
 100005000100005000100005000100005000
insertionSort() (activity a)        
selectionSort() (activity b)        
bubbleSort() (activity c)
shortBubbleSort() (activity d)        
mergeSort() (activity e)