Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

undefined Part 1: Naive Solution Write a simple program that will generate input lists of n = 1,000, n = 10,000, and n = 1,00,000

image text in transcribedimage text in transcribedundefined

Part 1: Naive Solution Write a simple program that will generate input lists of n = 1,000, n = 10,000, and n = 1,00,000 unique integers and a value k which the position where the kth smallest value is to be found. Write a sorting algorithm that will permute the input into an in- creasing list and then select the kth smallest value. I suggest using Quicksort as described by Hoare 5 and Bentley, but leave the choice of sort algorithm to you. Analysis What is the big-O behavior of your sort and select program? Use Excel to create a line chart showing the run-time on the the three inputs n = 1,000, n = 10,000, and n = 1,00,000. Show the trend lines and R-squared values on your chart. Does your empirical data agree with your big-0 analysis? Part 2: A Smarter Solution Implement the select algorithm described by Bentley, or Hoare, or the Corman et. al. textbook. Analysis Perform the same analysis for this program as described in the previ- ous section for part 1. What is the speed-up in execution time compared to program 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago