I was looking for an example of power being used for a binary search. Is
there an example of this in a wiki or a list post?
So far I've ended up with the below, which works well, but originally I was
aiming at doing a binary search using symbols. Probably there is a
crossover point where one outperforms the other. I don't need this to be
super fast right now, but probably it's a good thing to know.
t=.s:'`zero`one`two`three`four`five'
{. I. ; t =/ s:'`three' N.B. take first incase of duplicates. Also, s:
returns a one item list, hence the need for /
thanks,
-Steven
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm