Given an array with only 0 & 1. Can we have an algorithm which has all the following desirable characteristics-
The algorithm runs in $O(n)$ time.
The algorithm is stable.
The algorithm sorts in place.
I know the algorithms if only 2 characteristics are required but want to know if all the three characteristics possible simultaneously or not? If yes, how?
stable
mean when there isonly 0 & 1
? – greybeard Feb 03 '17 at 10:58