W
William
for example, there is an array: int a[]={2, 3, 1,3, 2,1};
i want to group it as: {2,2,3,3,1,1} , not care the order.
i can use std::sort( &a[0], &a[len-1]);
but this will also sort the array which will get less performance than
group.
how to do this by STL ? thanks
i want to group it as: {2,2,3,3,1,1} , not care the order.
i can use std::sort( &a[0], &a[len-1]);
but this will also sort the array which will get less performance than
group.
how to do this by STL ? thanks