greensync / interval-tree Goto Github PK
View Code? Open in Web Editor NEWA Ruby implementation of the centered interval tree
Home Page: http://en.wikipedia.org/wiki/Interval_tree
License: MIT License
A Ruby implementation of the centered interval tree
Home Page: http://en.wikipedia.org/wiki/Interval_tree
License: MIT License
The project description states that this is an augmented tree implementation when in fact it's very much a centered interval tree. Please fix.
Hello, I think am in need of an interval tree. I saw yours but it looks like it only handles a fixed set of ranges rather than allowing for inserts and deletes. Is that correct?
Ultimately I am working on this https://twitter.com/schneems/status/1479554521307176960 where I want to speed up this code: https://github.com/zombocom/dead_end/blob/0170bf3df9c045e4d5f042c6b161ff0c30f2efda/lib/dead_end/code_frontier.rb#L152-L154. I need to find all elements in a collection that are between two values.
I've begun attempting to write an augmented interval tree based on a red-black tree and then specializing it to optimize for querying elements that are completely within a given range. I'm doing one insert and one search for every operation so both need to be equally fast. Right now with a plain binary tree my insert is fast, but searching for contained entries is slower than a naive array iteration of N elements.
It's my belief that adding annotations to the red-black tree, (and possibly reversing the sort interval, so it's sorted on end key first and start key last) will allow me to eliminate more nodes from my search and hopefully give me better than naive time.
BTW thanks for open-sourcing this.
Travis builds have been inexplicably failing recently, and it's kinda slow to pick up the jobs.
We use Buildkite for our private repos, but for security reasons, we shouldn't use it for public repos, where PR branches build automatically.
Elsewhere, I've seen we've had luck with GitHub Actions, so let's go with that.
In current implementation, the result is not consistent:
IntervalTree::Tree.new(10..10).search(10)
=> [10...11]
IntervalTree::Tree.new(10..10).search(10..10)
=> []
The result of query 10..10 should be [10...11]
, too.
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.