5

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?

Mr. Sigma.
  • 1,301
  • 1
  • 16
  • 38

0 Answers0