Find the insert index for the given key in a sorted array.
The sorted array to search
The search key
Optional custom compare function
Find the insert index for the given key in a sorted array.