Driver code
public static void Main ( String [ ] args ) { int [ ] ar1 = { 1 , 2 , 3 , 6 } ; int [ ] ar2 = { 4 , 6 , 8 , 10 } ; int n1 = ar1 . Length ; int n2 = ar2 . Length ; if ( n1 != n2 ) { Console . WriteLine ( " Doesn ' t ▁ work ▁ for ▁ arrays ▁ " + " of ▁ unequal ▁ size " ) ; } else if ( n1 == 0 ) { Console . WriteLine ( " Arrays ▁ are ▁ empty . " ) ; } else if ( n1 == 1 ) { Console . WriteLine ( ( ar1 [ 0 ] + ar2 [ 0 ] ) / 2 ) ; } else { Console . WriteLine ( " Median ▁ is ▁ " + getMedian ( ar1 , ar2 , 0 , 0 , ar1 . Length - 1 , ar2 . Length - 1 ) ) ; } } }