Method for finding a median in a particular range of elements in an
array