int temp=arr[i];
arr[i]=arr[arr[i]-1];
arr[arr[i]-1]=temp;
This Swap part of the code is not working correctly. i have written same swap code for other sorting algorithms, but I am facing issue with this. Also anyone can please give me clarity on pass by value of java.