built a tree (not binary) where the root node is the initial configuration of pegs. For each possibility of movement of the initial configuration of disks, a child node is created. Thus, for each child node created, I check if the current configuration is the final configuration. If yes, problem was solved and we are done =). Otherwise its creates other child nodes of the current node. Note that the verification of the current configuration with the final configuration of the nodes is done by breadth-first search<http://en.wikipedia.org/wiki/Breadth-first_search>(this is the secret of this solution to find the smallest number of moves).
If u need i can give u the JAVA code for this -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
