Java program of kth smallest / largest in a small range unsorted array
import java . util . Arrays ; class GFG { static int maxs = 1000001 ; static int kthSmallestLargest ( int [ ] arr , int n , int k ) { int max_val = Arrays . stream ( arr ) . max ( ) . getAsInt ( ) ; int hash [ ] = new int [ max_val + 1 ] ;