From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cafc372bafbed3f1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-22 13:38:44 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dan@irvine.com (Dan Eilers) Newsgroups: comp.lang.ada Subject: Re: writing an "artful" algorithm Date: 22 Apr 2003 13:38:44 -0700 Organization: http://groups.google.com/ Message-ID: References: NNTP-Posting-Host: 66.126.103.122 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1051043924 17089 127.0.0.1 (22 Apr 2003 20:38:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 22 Apr 2003 20:38:44 GMT Xref: archiver1.google.com comp.lang.ada:36368 Date: 2003-04-22T20:38:44+00:00 List-Id: John Stoneham wrote in message news:... > So now I'm working on a different puzzle: write the most "artful" > solution to the problem, or, to put it another way, "How would Knuth do > it?" ... Well, you are in luck. Knuth's techniques for generating permutations are explained in gory detail in section 7.2.1.2 of The Art of Computer Programming, (part of the long-awaited Volume 4), and available online at: http://www-cs-staff.Stanford.EDU/~knuth/fasc2b.ps.gz See in particular the answers to exercises 9 and 41. -- Dan Eilers