Executes K-th order statistic. Average O(N). Swap elements in array. At the end, the K-th element will be under index k.
Return
k-th element from array
Parameters
element search ordinal number. 0 <k<= to - from
index from for search in array (inclusive)
index to for search in array (exclusive)
if true search in ascending order else in descending order