0% found this document useful (0 votes)
63 views

Lab Sorting Worksheet PDF

This document provides instructions for a lab assignment on sorting algorithms. Students are asked to: 1) Verify their sorting algorithms are correctly sorting arrays and get an instructor's initials. 2) Run timed experiments of sorting algorithms (selection sort, insertion sort, quicksort) for different input sizes and fill out a table with the results. 3) Predict the running times of the algorithms for an input size of 64,000 based on the theoretical efficiencies and observed times. 4) Determine from the experiments if there is a clear ranking of the algorithms from best to worst and present the results to the instructor.

Uploaded by

s_gamal15
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Lab Sorting Worksheet PDF

This document provides instructions for a lab assignment on sorting algorithms. Students are asked to: 1) Verify their sorting algorithms are correctly sorting arrays and get an instructor's initials. 2) Run timed experiments of sorting algorithms (selection sort, insertion sort, quicksort) for different input sizes and fill out a table with the results. 3) Predict the running times of the algorithms for an input size of 64,000 based on the theoretical efficiencies and observed times. 4) Determine from the experiments if there is a clear ranking of the algorithms from best to worst and present the results to the instructor.

Uploaded by

s_gamal15
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CSCE

156 Lab: Sorting & Efficiency


Worksheet

Name _________________________________

1. Verify that your sorting algorithms are correctly sorting by printing the content of the arrays and
demonstrating your results to a lab instructor. __________Instructor Initials
2. Run some timed experiments as outlined in the lab handout for each algorithm for various input
sizes. Note that you can restrict the number of locations loaded from the data file by changing
the value of n in the main method of the SortingPerformance class. Fill in the table
below (for best results, run the experiment at least three times each and take an average
running time unless youre feeling lazy).

Algorithm Theoretical Observed Average Running Time (seconds)


Efficiency
n = 2000 n = 4000 n = 8000 n = 20000
Java Sort O(nlog(n))

Selection Sort O(n^2)

Insertion Sort O(n^2)

Quick Sort O(nlog(n))

3. Without actually running the simulation, predict the running time of each algorithm for n =
64,000 based on the theoretical efficiency and observed running time.





4. According to your experiments, is there a clear ranking of the sorting algorithms? If so, list them
from best to worst. Present your results to the lab instructor.

_________________________________Instructor Signature

You might also like