1 / 4

CMP 338

Data Structures and Algorithms I Day 10, 10/6/11 Exam 1. CMP 338. Homework 9, due 11 pm 10/12. Implement insertion sort, merge sort, quicksort Compare performance of quicksort (four variations) insertion sort merge sort Turn in a) working code for all sort programs

rsouthern
Download Presentation

CMP 338

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Data Structures and Algorithms I Day 10, 10/6/11 Exam 1 CMP 338

  2. Homework 9, due 11 pm 10/12 Implement insertion sort, merge sort, quicksort Compare performance of quicksort (four variations) insertion sort merge sort Turn in a) working code for all sort programs b) performance numbers (standard out) c) performance graphs d) your interpretation of the data

  3. Homework 9 API public class Homework9(Homework9.java) public static void insertionSort(double[] a) public static void mergeSort(double[] a) public static void quicksort0(double[] a) public static void quicksort1(double[] a) public static void quicksort2(double[] a) public static void quicksort3(double[] a) All other methods are private and static (Including merge and partition) No other classes

  4. Homework 9 API, Continued Don't bother randomizing quicksort input quicksort0 Pivot is a[lo] (standard partition) quicksort1 Pivot is median of a[lo], a[hi], and a[(hi+lo)/2] quicksort2 Pivot is median of a[lo..hi] Implement linear select algorithm Partition by median is a side-effect of the algorithm quicksort3 Pivot is first pivot of linear select algorithm

More Related