Computers and Technology

Problem: The goal of this assignment is to empirically evaluate Quicksort with two different variations: (JAVA Program Preferably)
Use of a randomized pivot - index randomly chosen between positions low and high - compared to using a fixed pivot such as position low or high.
Switching to Insertion Sort for small sub-arrays, i. e. when high - low < threshold
To empirically measure the performance of Quicksort, you should track both:
The clock time taken by the algorithm (subtract clock time at start from clock time at end)
The number of comparison operations performed (use a global variable ncomp for number of comparisons, and increment it each time you do a comparison)
Run Quicksort for a variety of sizes (say n = 10, 100, 1000, 10000), for several trials of random data for each n, and track both the number of comparisons and clock time for each trial.
Assuming that the switch to Insertion Sort for smaller sizes improves performance, run additional trials to determine the optimal threshold, the point at which the algorithm switches from Quicksort to Insertion Sort.
Document all this in appropriate tables that clearly show the comparisons and clock-times for the various runs of your algorithm. Let the algorithm do the work and build the tables for you. (For Python users, Tabulate and Tabletext are two libraries that can help you achieve professional looking tables that document your effort and results.) You can also write results to a file if you cannot run them all at once.
(Instruction: It does not have to be a proper table, but should reflect the comparisons in a clear manner in the console output. General threshold for switching to Insersion Sort is about array size less than or equal to 10)

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, simbupls
Technician a says that the radiator usually cools better if the front air dam is removed. technician b says that when a condenser has a leak it can be repaired easily with epoxy. who is correct?
Answers: 1
image
Computers and Technology, 22.06.2019 22:30, MoneyMike42
Alex’s family members live in different parts of the world. they would like to discuss the wedding plans of one of their distant relatives. however, alex wants all the family members to talk to each other simultaneously so that they can make decisions quickly. which mode of internet communication should they use? a. blog b. email c. wiki d. message board e. instant messaging
Answers: 2
image
Computers and Technology, 24.06.2019 10:00, RG1971
(, urgent need): how do i change my username
Answers: 1
image
Computers and Technology, 24.06.2019 16:50, Laylahlettiere
Develop the program incrementally: a) start by reading and displaying each line of the input file to make sure you are reading the data set correctly. b) use the split string method to extract information from each line into a list. print the list to prove that this step is working correctly. d) convert the exam scores to type int and calculate the student’s average. display those items to prove this step is working correctly. e) create a tuple containing the six items for each student (name, exam scores, exam mean). display the tuples to prove this step is working correctly. (optionally, you may want to have the exam scores in a list so your tuple is (name, scores_list, f) append each tuple to a list. display the list to prove this step is working correctly. g) use the sort list method to re-order the tuples in the list. display the list to prove this step is working correctly. h) use a for statement to display the contents of the list as a table (with appropriate formatting). i) use a for statement to calculate the average of all scores on exam #1, then display the results. note that you could have calculated this average within the first loop, but we are explicitly requiring you to do this calculation by looping though your list of tuples. j) add the logic to calculate the average of all scores on exam #2, then display the results.
Answers: 2
Do you know the correct answer?
Problem: The goal of this assignment is to empirically evaluate Quicksort with two different variat...

Questions in other subjects: