You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a row of n checkers of three colors: red, white, and blue. Devise an algorithm to rearrange the checkers so that all the red checkers come first, all the white ones come next, and all the blue checkers come last. The only operations allowed are examination of a checker’s color and swap of two checkers. Try to minimize the number of swaps made by your algorithm.
The text was updated successfully, but these errors were encountered:
There is a row of n checkers of three colors: red, white, and blue. Devise an algorithm to rearrange the checkers so that all the red checkers come first, all the white ones come next, and all the blue checkers come last. The only operations allowed are examination of a checker’s color and swap of two checkers. Try to minimize the number of swaps made by your algorithm.
The text was updated successfully, but these errors were encountered: