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 [ 01 | May | 2003 ]


Date: Thu, 1 May 2003 19:28:56 PDT7
From: "Gregory W. Smith" <gsmith@well.com >
Reply-To: scoug-programming@scoug.com
To: scoug-programming@scoug.com
Subject: SCOUG-Programming: permutation

Content Type: text/plain

Here is a Python routine that uses a recursive algorithmn
to permute a list L:

def changering ( N ):
global L
if N==0: print L
for c in range(N):
L[c], L[N-1] = L[N-1], L[c]
changering ( N-1 )
L[c], L[N-1] = L[N-1], L[c]

Sedgewick attributes this algorithm to seventeenth century change
ringings (http://www.cs.princeton.edu/~rs/talks/perms.pdf). To
run the algorithm, define the list and call changering with the
length of the list.

L=['A','B','C']
changering(len(L))

I ran it with a list of eight items--it takes a while to scroll by.
-- Greg Smith

> Zdenek Jizba wrote:
> >
> > I wrote a quick (15 minutes) and dirty (tested only up
> > to 4 elements) permutation function using APL2. I will
> > bring it Saturday and run it if anyone is interested.
>
> Hi Jizba,
>
> Thanks. Unfortunately I won't be at the Saturday meeting.
>
> - Peter
--
Gregory W. Smith (WD9GAY) gsmith@well.com

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

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".

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


Return to [ 01 | May | 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.