Talk:Sort disjoint sublist: Difference between revisions

Content added Content deleted
(→‎Indices as collection: I wouldn't insist...)
(→‎Indices as collection: Would it matter?)
Line 10: Line 10:
I see that many languages take the indices as a general collection (or array) instead of specifically as a set. If they're doing that, should they also be enforcing uniqueness of the indices before progressing with the rest of the sort? (To be exact, failing to do this gives wrong answers…) –[[User:Dkf|Donal Fellows]] 16:45, 14 February 2011 (UTC)
I see that many languages take the indices as a general collection (or array) instead of specifically as a set. If they're doing that, should they also be enforcing uniqueness of the indices before progressing with the rest of the sort? (To be exact, failing to do this gives wrong answers…) –[[User:Dkf|Donal Fellows]] 16:45, 14 February 2011 (UTC)
:The task states that 6, 1, and 7 are given. I didn't want people to assume they got 1,6,7 in that order. I would therefore be inclined to not ''insist'' that a routine should also account for duplicates. (Although I had noted this addition in the TCL example which is fine). --[[User:Paddy3118|Paddy3118]] 17:01, 14 February 2011 (UTC)
:The task states that 6, 1, and 7 are given. I didn't want people to assume they got 1,6,7 in that order. I would therefore be inclined to not ''insist'' that a routine should also account for duplicates. (Although I had noted this addition in the TCL example which is fine). --[[User:Paddy3118|Paddy3118]] 17:01, 14 February 2011 (UTC)
::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)