Difference between revisions of "TADM2E 4.4"

From Algorithm Wiki
Jump to: navigation, search
(Recovering wiki)
 
(Recovering wiki)
Line 1: Line 1:
 
Algorithm:
 
Algorithm:
  
<pre>
+
<pre>
 
Create 3 buckets, one each for red, blue and yellow.
 
Create 3 buckets, one each for red, blue and yellow.
 
for each Pair P in the input
 
for each Pair P in the input
Line 7: Line 7:
  
 
Output the data from the red, blue and yellow buckets.
 
Output the data from the red, blue and yellow buckets.
&lt;/pre&gt;
+
</pre>

Revision as of 18:23, 11 September 2014

Algorithm:

Create 3 buckets, one each for red, blue and yellow.
for each Pair P in the input
   append P.number to the bucket P.color

Output the data from the red, blue and yellow buckets.