CSC 300 Data Structures in Java I: Lab 3 (11/7 Thu)

In this lab session, you do an empirical test of performance comparison of various sorting algorithms.

You should be able to do Part I and II during the lab.  At the end of the lab (or before 11:59 pm 11/6 Fri), submit "", which is described below.
Part III is optional.  If you have finished before the time, try Part III and have fun. 

Part I: Download Lab3 code zip and set up Eclipse

  1. Download “” from the course home page, posted under “Week 8”. Save it under “My Documents” (but ensure the ‘Destination path’ is showing c:\Users\xxxx\Documents’)
  2. Extract all files in the zip file under "My Documents" as well.
  3. Start Eclipse. When you are asked to enter a workspace, browse to select Lab3 in the folder under "My Documents" (whose absolute folder is C:\Users\xxx\Documents\Lab3).
  4. Now you create a new Java Project. From the top menu, select “File” and “New” and “Java Project”. Then in the pop-up window, type in algs4p for “Project name”. Then hit Finish.
  5. Now for this lab, all files/classes should be added in the folder "algs21". It's under "algs4p" -> "src" in the left 'Package Explorer' pane in Eclipse. Click on the folder "algs21" and expand it.

Part II: Writing MyBubble – the Bubble sort algorithm

Part III: Comparing performance of sorting algorithms

It is showing the performance of four different sorting algorithms (Insertion, Selection, Bubble, and the one used in the Java Array library (which is called "Dual-Pivot Quicksort")).  The values are the execution time (in nanosecond, and averaged over 5 runs).


Submit "" on COL, Lab3 bin, before 11:59 pm 11/8 Fri.