Dynamic allocation of output array
In version 0.1.0, the output array is allocated with the size of the smaller array and then later resized to match the actual size of array. If two large arrays with hardly any values in common are intersected, this is a huge waste of memory.
A more memory conscious implementation should start with a small array and enlarge the output array when needed.
The same applies to the index arrays proposed in issue !17 (merged).