Quote (irimi @ Nov 9 2012 03:13pm)
you need to ask better questions. you still haven't even showed that your algorithm is correct in the first place.
greedy algorithm simply means picking the locally optimal choice every step of the way, and the solution must be at least locally optimal (by definition). but you haven't really quite defined the metric for what "optimal" is to begin with. is it based on the length of the word? is it based on the number of steps you take to get the word?
that's what Im asking lol
I came to the conclusion that it's not greedy at all.
As you said, greedy algorithms take decisions that look better for 'em at that moment expecting to reach an optimal solition at the end, which is not always true.
My algorithm has only one decision to make, or no decision, just do one thing always.
But it does work, its isnt greedy, but works.