toberndo / interval-query Goto Github PK
View Code? Open in Web Editor NEWA data structure for storing intervals and finding overlaps with either segment tree or sequential query
License: MIT License
A data structure for storing intervals and finding overlaps with either segment tree or sequential query
License: MIT License
Is it possible to use this module directly in the browser without browserify? I've seen the (outdated) js files in the browser subdirectory, but is there an official way?
would be nice to identify half open interval overlaps as well
It doesn't seem like a user can assign their own id to an interval. Would it be possible to implement that functionality? Otherwise the intervals stored in the tree lose their meaning in my use case.
Thanks!
Maybe instead of returning an Array of all the intervals as objects with a new overlap
property, it would be easier for me as a user of this code to get an array of overlapping intervals.
var tree = new segmentTree();
tree.pushInterval(1, 3, int1);
tree.pushInterval(2, 6, int2);
tree.pushInterval(7, 9, int3);
tree.buildTree();
console.log(tree.queryOverlap());
{
intervals : [2,3] // these are overlapping
names : [int1, int2] // the names of the overlapping intervals (very helpful)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.