Word ladder: Difference between revisions

Content added Content deleted
(→‎{{header|Haskell}}: added alternative solution)
m (→‎Breadth-first search: fixed a typo)
Line 259: Line 259:
=={{header|Haskell}}==
=={{header|Haskell}}==
=== Breadth-first search===
=== Breadth-first search===
First expands a ball around the starting word in the word space, until it's surface contains the goal (if possible). After that performs depth-first path-finding from the goal back to the center.
The function first expands a ball around the starting word in the space of possible words, until the ball surface touches the goal (if ever). After that it performs depth-first path-finding from the goal back to the center.


<lang haskell>import System.IO (readFile)
<lang haskell>import System.IO (readFile)