Some years ago I defined them as
  u =: [: ~. ,
  n =: (# @:[ > i.)#]

Regards, Markus

Kip Murray schrieb:
> The following is easy but interesting.
>
> A "set" is a numeric vector without repetitions.  Provide definitions for the 
> union u and intersection n of two sets:
>
>     1 2 3 4 u 3 4 5 6  NB. elements of one or the other
> 1 2 3 4 5 6
>
>     1 2 3 4 n 3 4 5 6  NB. common elements
> 3 4
>
> ----------------------------------------------------------------------
> 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