Not quite, your algorithm has j going from i+1 to n, and swapping when a[i] > a[j].
OP's algorithm has both indexes going from 1 to n, and swapping when a[i] < a[j].
Yours is more efficient and easy to see why it's correct, but OP's is slightly simpler and more surprising.