Talk:ABC problem: Difference between revisions

(→‎order of blocks: new section)
Line 51:
The python iterative solution is greedy and not garanteed to find a solution. Example: if blocks are "AB", "AB", "AC" and "AC", it may fail to find a solution for the word "ABBA". This particular algorithm only works if each letter appears on only one type of blocks. Not finding a solution when there is one is a matter of correctness. Either the task should put further constraints on the blocks ("All blocks containing letter A are of the same letter combinations"), or such algorithms should clearly state the chance of failure ("This is a greedy algorithm that's fast but may fail to find an answer"). --[[User:Ledrug|Ledrug]] ([[User talk:Ledrug|talk]]) 20:12, 10 January 2014 (UTC)
:Excellent point and a good test case! I shall look into updating the example.--[[User:Jking|Jking]] ([[User talk:Jking|talk]]) 21:08, 10 January 2014 (UTC)
 
== order of blocks ==
 
I found a problem with the original version 1 of REXX:
<br>blocks = 'US TZ AO QA'
<br>word = 'Auto' could not be spelt when taking AO for the A of AUTO.
<br>This program was meanwhile corrected.
<br>PL/I shows the same problem.
Therefore I created version 2 for these two languages
(which are the ones I know rather well).
I cannot say how other languages' solutions behave.--[[User:Walterpachl|Walterpachl]] ([[User talk:Walterpachl|talk]]) 19:58, 11 January 2014 (UTC)
2,289

edits