Jump to content

Talk:Sort disjoint sublist: Difference between revisions

(→‎Indices as collection: You're right.)
Line 12:
::It seems like having duplicate indicies wouldn't change the outcome, but it would waste a few cycles reassigning the same number to the same index. some computer languages might not work like my brain though. --[[User:Mwn3d|Mwn3d]] 18:21, 14 February 2011 (UTC)
:::The problem is that the repeated indices will not, in general, correspond to the location of the repeated data, once the data is sorted. --[[User:Rdm|Rdm]] 18:25, 14 February 2011 (UTC)
::::You're right. I tried the example on the main page using "6, 6, 1, 7" for the indices. Another solution would be to sort the indices after they come in. You could use the same sort function for that as you do for the data. Either way, it's an extra step. I vote for progrmamer's choice and let the indices come in however they will. --[[User:Mwn3d|Mwn3d]] 19:00, 14 February 2011 (UTC)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.