It's wonderful but just before talking about this code run-time speed and other characteristics correct obvious errors in it. Now you can't compile this code: arr1 is not declared in the merge function (if it's a global variable better don't display this "improved" sort function)...
When you compile this improved merge sort code you can test and profile it - and you will get all answers to your questions...
PS. As usually, xor based solution is much more expensive than a simple swap...
Reputation Points: 1234
Solved Threads: 347
Postaholic
Offline 2,001 posts
since Jul 2008