But there is flaw in grep-algorithm: it does not union correctly, if first array is shorter than second. If you consider this, then the for-algorithm will about 6-7% faster.
In reply to Re^3: Fast, Efficient Union and Intersection on arrays
by wanradt
in thread Fast, Efficient Union and Intersection on arrays
by barvin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |