Question: Design an experiment to compare different algorithms for Selection problem. Consider the problem of finding kth smallest element in an unsorted list of n numbers.
Design an experiment to compare different algorithms for Selection problem. Consider the problem of finding kth smallest element in an unsorted list of n numbers. There are following candidate methods: (i) Sorting by Insertion-sort and returning the kth element in the list, (ii) Sorting by Merge-sort and returning the kth element in the list, (iii) Not sorting the list, but applying quick select algorithm, which is based on array partitioning, as described in the class. While partitioning, choose the pivot element as the first element in an array. (iv) Applying quick select algorithm, but this time using median-of-three pivot selection 1 , In this experiment, you are asked to compare these four methods for different values of k and various input lists (of various sizes and various characteristics). You have to decide on sample inputs to best clarify the performance characteristics of algorithms. While doing your emprical analysis, you may use physical unit of time, count actual number of basic operation's executions, or both. You are also expected to compare your findings with theoretical complexity values. You should provide extensive comments on your results. This homework has three main steps: Step 1: Designing the Experiment: This step includes: (a) Deciding on reasonable inputs / generating reasonable sample inputs 2 . (b) Deciding on k values 3 . (b) Deciding on reasonable metrics (for complexity measurement). You should clearly describe all these decisions and reasons behind your decisions in your detailed report. Step 2: Coding and Running: All algorithms should be implemented in any programming language and experiments should be performed for decided input lists and k values, and results should be evaluated in terms of decided metrics. Step 3: Illustrating and Analyzing Results: This step includes: (a) Providing some plots or tables to illustrate performance of the algorithms. (b) Comparing the performance of two algorithms for different inputs with various sizes, and for different values of k. (c) Describe whether your findings meet theoretical expectations. You should provide detailed comments for your findings in these comparisons.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
