sorted-intersect
Intersect sorted lists using merge intersection with galloping lookahead.
npm install sorted-intersect
It is useful if you want to (efficiently) intersect large, sorted lists.
Usage
It is easy to use
var intersect = require('sorted-intersect');
var intersection = intersect([
[4,6,7,8,9,10],
[6,7,8,10],
[7,8,10],
[4,5,6,7,8,9,10,11,12]
]);
console.log(intersection);
intersect(lists, options) takes an optional second parameter
which can contain the following options
{
limit: number,
marker: value,
offsets: []
}
License
MIT