-
1d(interval-tree):一维间隔树
资源介绍
间隔树1d
简单的一维间隔树。 支持O(log(n))摊销更新和O(log(n))查询。
例子
var createIntervalTree = require ( "interval-tree-1d" )
//Create some random list of intervals
var intervals = [ [ 1 , 2 ] , [ - 1 , 0 ] , [ 0.5 , 1 ] , [ - 10 , 10 ] ]
//Build tree
var tree = createIntervalTree ( intervals )
//Find all intervals containing query point 0.7
console . log ( "querying point:" , 0.7 )
tree . queryPoint ( 0.7 , function