Talk:Sorting algorithms/Cycle sort: Difference between revisions

From Rosetta Code
Content added Content deleted
m (→‎number of writes: nevermind.)
Line 10: Line 10:


Nevermind, I see the algorithm was only counting writes to the original array. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 22:37, 13 June 2014 (UTC)
Nevermind, I see the algorithm was only counting writes to the original array. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 22:37, 13 June 2014 (UTC)


==4 REXXen==
Hi. Comparing the four REXX versions as a non-REXX programmer, the first seems neat and tidy in comparison to the other three that seem squashed in comparison. Are the other three really idiomatic and showing REXX off to advantage? Do you really want to show, for example, the single line while statements; or the code so squashed into the comments? --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 22:47, 13 June 2014 (UTC)

Revision as of 22:47, 13 June 2014

number of writes

Am I missing something or is the sample algorithm (on the Wiki article Cycle sort) incorrect in regards to the number of item writes (when placing items in the array)?

Whenever a swap is done, the write count is bumped by 1 (one), but in fact, two writes are done (for two items, agreeably it was done with a swap so it may appear that only one write was performed).   It appears it's counting swaps instead of writes. -- Gerard Schildberger (talk) 22:32, 13 June 2014 (UTC)

I only mention it as it appears one of the benefits of a cycle sort is the low number of writes being used during the cycle sort process. -- Gerard Schildberger (talk) 22:35, 13 June 2014 (UTC)


Nevermind, I see the algorithm was only counting writes to the original array. -- Gerard Schildberger (talk) 22:37, 13 June 2014 (UTC)


4 REXXen

Hi. Comparing the four REXX versions as a non-REXX programmer, the first seems neat and tidy in comparison to the other three that seem squashed in comparison. Are the other three really idiomatic and showing REXX off to advantage? Do you really want to show, for example, the single line while statements; or the code so squashed into the comments? --Paddy3118 (talk) 22:47, 13 June 2014 (UTC)