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
function kthSmallest ( arr , low , high , k ) {