Merge sort C# time and space efficiency
mid = (endIndex + startIndex) / 2; may overflow. A canonical idiom is

    mid = startIndex + (endIndex - startIndex)/2;

Allocating (and deallocating) a new temp array in each invocation is a waste of time. Allocate the entire temp once, and pass it down, using same indices as for the actual array. Notice that it also allows to not copying data back from temp to array, which is another waste of time. Instead, ping-pong the arrays' roles.

Of course, it doesn't affect the asymptotic, but should speed it up twofold.
The algorithm looks much more natural with semi-open ranges (that is, end is one after the last element. This will avoid +1 and -1 index corrections, and use &lt; instead of &lt;= to compare indices.