On Wed, Mar 17, 2010 at 10:43 AM, bill lam <[email protected]> wrote:
> Does it assume the original list pre-sorted?
> f 0 2 3 6
> 1 4 5
> f 2 0 6 3
> 0 1 5 4 3 1 2 3 4 5 10 9 8 7
Of course, if the original list is pre-sorted, we could use
f=: -.~ {:
Also, using 2 f0\ would not be faster than this:
Consider:
f 6000
f 2*i.3000
f i.6000
In all three cases, 2 f0\ must do more work
than f
FYI,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm