On Sun, May 1, 2011 at 10:10 PM, Ian Clark <[email protected]> wrote: > I was well aware of the properties of grade-up (⍋) -- after all it > returns a rearrangement to the ordered list, ie inverts the > rearrangement -- but didn't use it because it did a sort, preferring > to use iota (⍳) --c/f (i.). > > I note your point that we have much better sorts nowadays... > > ] p=: 8?8 > 6 0 1 7 2 3 5 4 > I=: i.8 > p i. I NB. invert p > 1 2 4 5 7 6 0 3 > /:p NB. ditto > 1 2 4 5 7 6 0 3
Don't forget that there's a third solution, which could be better than either of the search and the sort: l p} p 1 2 4 5 7 6 0 3 Ambrus ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
