Skip to main content

Section 8.9 Sorting Benchmark

Subsection 8.9.1 Goals

Understand the performance of sorting algorithms by implementing and benchmarking them.

Subsection 8.9.2 Tasks

We will be sorting arrays of integers. Here is the starting file: sorting.java 1 
  1. Implement selection sort algorithm in pseudocode. (5 points)
  2. Implement bubble sort algorithm in pseudocode. (5 points)
  3. Implement selection sort algorithm in Java (10 points)
  4. Implement bubble sort algorithm in Java (10 points)
  5. Document how the algorithm works in your code. (5 points)
  6. Benchmark the two algorithms against the standard sorting algorithm provided in the standard library.
  7. Take the BRIDGES Survey about the assignment (5 points)
This assignment uses BRIDGES to visualize the runtime of sorting algorithms based on the size of input array. You will need your BRIDGES account with the api key to visualize the assignment.
The scaffolded code comes with the main function and 3 static functions. One of the static functions does the built-in java sorting algorithm. You must write the selection sort algorithm in the ’sort’ function and the bubble sort algorithm in the ’bubbleSort’ function. The main function creates the BRIDGES objects and sorting benchmark objects for you. The input to these functions is a basic array, so no need to make any BRIDGES calls. Just write the sorting function to sort the input array. BRIDGES will log the time for you.
You have attempted of activities on this page.
uncc.instructure.com/courses/16965/files/21470894?wrap=1