I want to modify QuickSort (in Java) so that every time Partition is called, the median of the proportioned array is used as the pivot.
I have a median selection algorit
What you are looking for is the Selection Algorithm. Here's a link with pseudocode.
From the link:
In computer science, a selection algorithm is an algorithm for finding the kth smallest number in a list
To find the median you want to find the k=floor((n+1)/2) smallest number in the list where n is the size of the list.