Driver code
static void Main ( ) { int [ ] a = { 4 , 9 , 4 , 4 , 1 , 9 , 4 , 4 , 9 , 4 , 4 , 1 , 4 } ; int size = a . Length ; static void swap < T > ( ref T lhs , ref T rhs ) { T temp ; temp = lhs ; lhs = rhs ; rhs = temp ; }