SCOUG Logo


Next Meeting: Sat, TBD
Meeting Directions


Be a Member
Join SCOUG

Navigation:


Help with Searching

20 Most Recent Documents
Search Archives
Index by date, title, author, category.


Features:

Mr. Know-It-All
Ink
Download!










SCOUG:

Home

Email Lists

SIGs (Internet, General Interest, Programming, Network, more..)

Online Chats

Business

Past Presentations

Credits

Submissions

Contact SCOUG

Copyright SCOUG



warp expowest
Pictures from Sept. 1999

The views expressed in articles on this site are those of their authors.

warptech
SCOUG was there!


Copyright 1998-2024, Southern California OS/2 User Group. ALL RIGHTS RESERVED.

SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group. OS/2, Workplace Shell, and IBM are registered trademarks of International Business Machines Corporation. All other trademarks remain the property of their respective owners.

The Southern California OS/2 User Group
USA

SCOUG-Programming Mailing List Archives

Return to [ 16 | April | 2003 ]

<< Previous Message << >> Next Message >>


Date: Wed, 16 Apr 2003 22:17:47 PDT
From: "Robert Blair" <blairra@tstonramp.com >
Reply-To: scoug-programming@scoug.com
To: scoug-programming@scoug.com
Subject: SCOUG-Programming: enumerate all permutations ?

** Reply to message from Peter Skye on Wed, 16 Apr 2003
21:02:11 PDT

> I did at first go to Google but was stymied by the massive number of
> references, and was hoping that someone could simply suggest a "best"
> algorithm. The best reference I have found so far is "Permutations by
> Interchanges" by B. R. Heath (1963) which Sedgewick claims is the
> fastest known, but finding Heath's paper was a chore. I have finally
> located it (in TIF format!) at The Oxford University Press in England.

I just looked at Knuth to see what he has to say and there is a description on
page 44. So I whipped out a quick and dirty REXX to do it. If you need this
for a much larger number of objects you may want to optimize this code.

/* REXX permutations.cmd */

item.1 = 'item 1'
item.2 = 'item 2'
item.3 = 'item 3'

/* pick first item for this pass */

do i = 1 to 3

/* pick second item for this pass */

do k = 1 to 3

if i = k then iterate
/* pick third item for this pass */
do j = 1 to 3

if i = j then iterate
if k = j then iterate
say item.i item.k item.j

end /* do j = 1 to 3 */

end /* do k = 1 to 3 */

end /* do i = 1 to 3 */

exit

--
Robert Blair

=====================================================

To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".

For problems, contact the list owner at
"rollin@scoug.com".

=====================================================


<< Previous Message << >> Next Message >>

Return to [ 16 | April | 2003 ]



The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA

Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS RESERVED.

SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group. OS/2, Workplace Shell, and IBM are registered trademarks of International Business Machines Corporation. All other trademarks remain the property of their respective owners.