Find the index to insert an element in array keeping the sort order.