Driver Code
public static void Main ( String [ ] args ) { int [ ] array = { 10 , 4 , 5 , 8 , 6 , 11 , 26 } ; int [ ] arraycopy = { 10 , 4 , 5 , 8 , 6 , 11 , 26 } ; int kPosition = 3 ; int length = array . Length ; if ( kPosition > length ) { Console . WriteLine ( " Index ▁ out ▁ of ▁ bound " ) ; } else { Console . WriteLine ( " K - th ▁ smallest ▁ element ▁ in ▁ array ▁ : ▁ " + kthSmallest ( arraycopy , 0 , length - 1 , kPosition - 1 ) ) ; } } }