Jump to content

Dutch national flag problem: Difference between revisions

m
added whitespace to the task's preamble, added wording in case the image isn't viewable.
(Dutch national flag problem en FreeBASIC)
m (added whitespace to the task's preamble, added wording in case the image isn't viewable.)
Line 2:
[[File:Dutch_flag_3.jpg|350px||right]]
 
The Dutch national flag is composed of three coloured bands in the order red then white and lastly blue. The problem posed by [[wp:Edsger Dijkstra|Edsger Dijkstra]] is:
::*   red     (top)
:Given a number of red, blue and white balls in random order, arrange them in the order of the colours Dutch national flag.
::*   then white,   and
::*   lastly blue   (at the bottom).
 
 
The problem posed by [[wp:Edsger Dijkstra|Edsger Dijkstra]] is:
:Given a number of red, blue and white balls in random order, arrange them in the order of the colours in the Dutch national flag.
When the problem was first posed, Dijkstra then went on to successively refine a solution, minimising the number of swaps and the number of times the colour of a ball needed to determined and restricting the balls to end in an array, ...
 
 
;Task
Cookies help us deliver our services. By using our services, you agree to our use of cookies.