A more obvious question is why not let ~,,/: and \: do the work. Roger has a very efficient set of guts for these. If the problem is sufficiently large that timing is important its not clear to me that the other proposals will be faster (I hav'nt run any timing).

I am reminded of the ever present problem of worrying about run efficiency before the problem is solved, though it can't be ignored in all cases.

Ralph S


On Thu, 20 Mar 2008, Raul Miller wrote:

2008/3/20 Nick Kostirya <[EMAIL PROTECTED]>:
Can we manage this without sorting?

Sure, if you change your problem definition so that it does
not require sorting.

For example:
     6 (<: [EMAIL PROTECTED] ]) 6 3 9 6 7 5
6 9 7
     6 (] i. <: [EMAIL PROTECTED] ]) 6 3 9 6 7 5
0 2 4
     6 (] (],:i.) <: [EMAIL PROTECTED] ]) 6 3 9 6 7 5
6 9 7
0 2 4

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

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

Reply via email to