Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that correctly implements both the Quicksort and Mergesort algor

ID: 3552282 • Letter: W

Question

Write a program that correctly implements both the Quicksort and Mergesort algorithms.  


The program should:

generate an array of 500 random numbers in the 1-100 range.  


The program should:

sort the same set of numbers and keep time stamps of how long it takes to sort them. The sorting times of each algorithm should be output when the program finishes.


PLEASE COMPLETE ALL RULES TO COMPLETE ASSIGNMENT. CAN USE JAVA OR C++



Write a program that correctly implements both the Quicksort and Mergesort algorithms. The program should generate an array of 500 random numbers in the 1-100 range. The program should sort the same set of numbers and keep time stamps of how long it takes to sort them. The sorting times of each algorithm should be output when the program finishes. You may write your program in Java, C++, or C . No other languages will be accepted. The rubric below will be used in the grading of your program. Partial points may be awarded for each category.

Explanation / Answer

#include #include #include #include #include #include std::string gen_random() { size_t len = rand() % 25 + 5; std::string x; std::generate_n(std::back_inserter(x), len, rand); return x; } static const int num = 10000000; int main(){ std::vector strings; std::generate_n(std::back_inserter(strings), num, gen_random); clock_t start = clock(); std::sort(strings.begin(), strings.end()); clock_t ticks = clock() - start; std::cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote