Driver code to test above methods
public static void Main ( ) { int [ ] arr = { 3 , 4 , 3 , 5 , 2 , 3 , 4 , 3 , 1 , 5 } ; int n = arr . Length ; int idxOfEle = 5 ; Console . WriteLine ( getIndexInSortedArray ( arr , n , idxOfEle ) ) ; } }