[racket] question about permutation

From: Stephen Bloch (sbloch at adelphi.edu)
Date: Mon Feb 14 19:13:48 EST 2011

On Feb 13, 2011, at 7:42 PM, Xiaojian Wang wrote:

> I want to make a permutation of a word, for example 1 2 3
> 
> it should return 
> 1 2 3
> 1 3 2
> 2 1 3
> 2 3 1
> 3 1 2
> 3 2 1
> 
> or 
> (list (list 1 2 3)
>       (list 1 3 2)
>         .
>         .
>         .

This is one of my favorite homework problems.  It really separates the students who have learned the Design Recipe from those who haven't.  Which are you? :-)


Stephen Bloch
sbloch at adelphi.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110214/8d63cfd7/attachment.html>

Posted on the users mailing list.