Talk:Sort stability: Difference between revisions

From Rosetta Code
Content added Content deleted
Line 4: Line 4:
What purpose does it serve to exclude languages that can implement the task as a user routine? --[[User:Tinku99|Tinku99]] 05:08, 7 June 2009 (UTC)
What purpose does it serve to exclude languages that can implement the task as a user routine? --[[User:Tinku99|Tinku99]] 05:08, 7 June 2009 (UTC)
:Hi Tinku, Some people, especially those new to a language, might not know too much about the facilities that the language comes with. This task is a comparison of what languages provide rather than what they can be programmed to provide and might be just as useful.<br> [[Integer literals]], [[Mutual Recursion]], and [[Common number base formatting]] are some other tasks that similarly try to contrast the 'native' capabilities of each language. --[[User:Paddy3118|Paddy3118]] 09:08, 7 June 2009 (UTC)
:Hi Tinku, Some people, especially those new to a language, might not know too much about the facilities that the language comes with. This task is a comparison of what languages provide rather than what they can be programmed to provide and might be just as useful.<br> [[Integer literals]], [[Mutual Recursion]], and [[Common number base formatting]] are some other tasks that similarly try to contrast the 'native' capabilities of each language. --[[User:Paddy3118|Paddy3118]] 09:08, 7 June 2009 (UTC)

==J and stability?==
Please excuse me, I don't intend to bang on about J, but sorting in ascending order might not be the same thing as a stable sort. The example given in the task description I would say does ''not'' sort other columns in ascending order. If the column being sorted on (the second column), has the same values then the relative order of those rows must stay the same. The table has the US and UK Birmingham rows in ''reverse'' alphabetical order w.r.t. the first column. A stable sort would leave the US above the UK Birmingham. If J would swap them then it does not do a stable sort. --[[User:Paddy3118|Paddy3118]] 20:25, 28 August 2009 (UTC)

Revision as of 20:25, 28 August 2009

Why not ask for a stable sort?

Why not just ask for an implementation of a stable sort?
What purpose does it serve to exclude languages that can implement the task as a user routine? --Tinku99 05:08, 7 June 2009 (UTC)

Hi Tinku, Some people, especially those new to a language, might not know too much about the facilities that the language comes with. This task is a comparison of what languages provide rather than what they can be programmed to provide and might be just as useful.
Integer literals, Mutual Recursion, and Common number base formatting are some other tasks that similarly try to contrast the 'native' capabilities of each language. --Paddy3118 09:08, 7 June 2009 (UTC)

J and stability?

Please excuse me, I don't intend to bang on about J, but sorting in ascending order might not be the same thing as a stable sort. The example given in the task description I would say does not sort other columns in ascending order. If the column being sorted on (the second column), has the same values then the relative order of those rows must stay the same. The table has the US and UK Birmingham rows in reverse alphabetical order w.r.t. the first column. A stable sort would leave the US above the UK Birmingham. If J would swap them then it does not do a stable sort. --Paddy3118 20:25, 28 August 2009 (UTC)