XZminX
February 18th, 2006, 03:14 PM
I was just wondering how does the partial_sort() places the unsorted elements.
Consider I wanna sort this vector.
2 3 1 5 6 2 4 7 9 12 3 11
from begin() to begin()+5
So the output would be (tested):
1 2 2 3 3 6 5 7 9 12 4 11
and when I put sort from begin() to begin()+6 I get:
1 2 2 3 3 4 6 7 9 12 5 11
Are the elements that dont get into sorted sequence placed randomly?
Because, I see no evidence that their positions have remained unchanged related to each other. If so, the first sort would yield:
1 2 2 3 3 5 6 4 7 9 12 11
and not
1 2 2 3 3 6 5 7 9 12 4 11
Thanks for replies.
Consider I wanna sort this vector.
2 3 1 5 6 2 4 7 9 12 3 11
from begin() to begin()+5
So the output would be (tested):
1 2 2 3 3 6 5 7 9 12 4 11
and when I put sort from begin() to begin()+6 I get:
1 2 2 3 3 4 6 7 9 12 5 11
Are the elements that dont get into sorted sequence placed randomly?
Because, I see no evidence that their positions have remained unchanged related to each other. If so, the first sort would yield:
1 2 2 3 3 5 6 4 7 9 12 11
and not
1 2 2 3 3 6 5 7 9 12 4 11
Thanks for replies.