Question: (50%) As mentioned in the class, the selection problem can be solved by the following two methods. The first method is to use the quick

 (50\%) As mentioned in the class, the selection problem can be

(50\%) As mentioned in the class, the selection problem can be solved by the following two methods. The first method is to use the quick sort to sort the given $n$ numbers in ascending order and pick out the $k$- th largest number from the sorted array. The second method is to utilize the prune and search strategy as introduced in the class. Use a programming language you familiar with to implement these two methods for solving the selection problem $(30 \%)$ and compare their running time when the input size $n$ is from 10000 to 30000 in steps of $1000 (20 %)$. Note that you should implement the quick sort program by yourself, instead of using the built-in quick sort function in the programming language. Note also that for each $n$, you should generate three problem instances and average the running time of solving these three instances. cs.vs. 1250||

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!