Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
译: 给定一个大小为n的数组,其中包含的元素对象为红、白、蓝,将其进行毗连的排序,顺序为红、白、蓝。在此我们用0,1,2来代表红白蓝三个颜色。
网友评论