Manoj Talreja Manoj Talreja - 1 year ago 138
C# Question

Array.Reverse algorithm?

What kind of algorithm Array.Reverse(string a), uses behind the scene to reverse the string?

Answer Source

Probably a standard in-place reversal algorithm.

function reverse-in-place(a[0..n])
 for i from 0 to floor(n/2)
     swap(a[i], a[n-i])


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download