C ++ program of kth smallest / largest in a small range unsorted array
#include <bits/stdc++.h> NEW_LINE using namespace std ; #define maxs  1000001 NEW_LINE int kthSmallestLargest ( int * arr , int n , int k ) { int max_val = * max_element ( arr , arr + n ) ; int hash [ max_val + 1 ] = { 0 } ;