finds the kth position ( of the sorted array ) in a given unsorted array i . e this function can be used to find both kth largest and kth smallest element in the array . ASSUMPTION : all elements in [ ] arr are distinct
static int kthSmallest ( int [ ] arr , int low , int high , int k ) {