Driver code
static void Main ( ) { int k = 3 ; int [ ] arr = { 2 , 6 , 3 , 12 , 56 , 8 } ; int n = arr . Length ; sortK ( arr , n , k ) ; Console . WriteLine ( " Following ▁ is ▁ sorted ▁ array " ) ; printArray ( arr , n ) ; } }