Blockquote
I came across this problem on a competitive programming site : 'CodeChef'. I was given a binary string and I had to sort it using the following operation : "I could take any substring and reverse it". I solved the problem using my code but I am unable to prove that the string can always be sorted using the above operation finite number of times.
Problem : https://www.codechef.com/START46C/problems/SRTARR
Can anyone help me with it?
A bubble sort is proven to finish in a finite number of steps, and using the rule it is possible to swap two elements.