Question: Write a c++ program that uses quickselect algorithm to find the median of an array. quickselect algorithm can be found here: https://www.geeksforgeeks.org/quickselect-algorithm/ Note: A median
Write a c++ program that uses quickselect algorithm to find the median of an array.
quickselect algorithm can be found here:
https://www.geeksforgeeks.org/quickselect-algorithm/

Note: A median is the middle number of the array after it is sorted. And in this problem, we return the N/2-th number after sorted if there are even numbers in the array. Do not sort the array to find the median! Example: Given [4, 5,1, 2, 3], return 3 Given [7, 9, 4, 5], return 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
