We generate permutation of given array randomly until we get it sorted.
It's expected complexity should be factorial n for n sized array, but I saw on google it's factorial n+1.
Can anyone explain to me how is it factorial n+1, because for a binomial distribution E(x) = 1/p(x).
Please purify my understanding.
Also is there any sorting algorithm better than bogosort ?