Skip to content

Instantly share code, notes, and snippets.

View Floofies's full-sized avatar
🧩
Looking for a job

Dani Glore Floofies

🧩
Looking for a job
View GitHub Profile
function IntervalTree() {
this.intervals = [];
this.intervals[0] = [];
this.nodes = [];
}
IntervalTree.prototype.addInterval = function (unit, id) {
if (id > this.intervals.length - 1) {
this.intervals[id] = [];
}
this.intervals[id][this.intervals[id].length] = unit;