Talk:Sattolo cycle: Difference between revisions

Content added Content deleted
Line 24: Line 24:


You need an array with at least two elements to make sure each element ends up in a new position. The single element in an array with one element cannot end up in new position. The possible output array shown for the test case [10] doesn't meet the task description, as all elements in that array did end up in their original position. [[User:Dedalus|Dedalus]] ([[User talk:Dedalus|talk]]) 12:29, 3 April 2017 (UTC)
You need an array with at least two elements to make sure each element ends up in a new position. The single element in an array with one element cannot end up in new position. The possible output array shown for the test case [10] doesn't meet the task description, as all elements in that array did end up in their original position. [[User:Dedalus|Dedalus]] ([[User talk:Dedalus|talk]]) 12:29, 3 April 2017 (UTC)

: The pseudocode in the task description performs this operation zero times for that case. The reason for this is the same reason it does not shuffle the two element array twice (resulting in an identity operation). --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 15:39, 3 April 2017 (UTC)