view graphs_trees/wordpath/question.rst @ 0:20fea762903e

Import some exercises and solutions
author Louis Opter <kalessin@kalessin.fr>
date Sat, 29 Jun 2013 19:30:31 -0700
parents
children
line wrap: on
line source

Wordpath
========

Write a function ``wordpath(word1, word2)`` that print all the permutations
needed to go from word1 to word2.

The only accepted permutation is to change a letter. Each generated word must
be in the dictionary, and a ``is_in_dictionary(word) → bool`` function is
provided.

Twists
------

- What is the time complexity?