Talk:Dutch national flag problem: Difference between revisions

→‎Algorithms: You can still explore algorithms.
(→‎Algorithms: You can still explore algorithms.)
Line 9:
: That's completely backwards. Making a Dutch flag isn't an idiomatic thing to do no matter what language you use, and the Python and J examples' using built-in sort completely missed the point. What's interesting about the problem is that, if you know sorting the array only involves comparing a samll set of values (3 in this case), you can have an O(n) method instead of O(n log(n)) as with a standard sort. Using an "idiomatic", non-specific method here makes no sense: there are plenty other sorting tasks on RC you can go idiomaticize with, why make yet another one?
: BTW, the J comment about bin sort (counting sort) isn't entirely correct: two elements may compare equal for this sorting purpose, but it doesn't mean they are necessarily identical. That is, balls with the same color may still be distinguishable from each other, and the sort routine shouldn't automatically assume otherwise. --[[User:Ledrug|Ledrug]] 02:57, 2 July 2012 (UTC)
 
::The wording does not stop you from using other algorithms and listing their relative strengths. I've just added a second Python entry myself. --[[User:Paddy3118|Paddy3118]] 06:39, 2 July 2012 (UTC)
 
== "ensuring that they are not in the order of the Dutch national flag" ==
Anonymous user