Ah, but solving such problems keeps me sane,
countering the bad effects of too much of gerunds 
and f. and $. and other wickedness in the wicked 
programming language.

No doubt 
   name=: x A. name
   name=: (<i,j) C. name
will be required for efficiency even if
   name=: p{name
will be available.  For the last expression simply 
generating p itself already costs O(n) space.

Regarding your last point:
http://www.jsoftware.com/jwiki/Essays/Symmetric_Array



----- Original Message -----
From: John Randall <[EMAIL PROTECTED]>
Date: Thursday, July 13, 2006 11:53 am
Subject: Re: [Jprogramming] special coding for stack operations

> Roger Hui wrote:
> > Once you assume that an operation is to be done
> > in place, swapping items at the front or at
> > the back are the same.  There is free space
> > at the back and none at the front, but neither
> > matter if you are just swapping.
> >
> > As you'd indicated, in general the operation is:
> >    name=: p{name
> > where p is a permutation and p=&#name .
> 
> Roger:
> 
> Maybe this is solving the problem in too much generality to be
> efficient.
> 
> Postscript gets by with just two operations for this purpose: swap
> (which interchanges the top two elements on the stack) and roll (which
> does a cyclic shift of the top n elements).  As you know, a
> transposition and a cycle of length n will generate the permutation
> group on n letters.


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to