IntervalTreeNode

Consumer needs to use this with insert functions (unlike splaytree fns, which take interval directly)

struct IntervalTreeNode (
IntervalType
) if (
__traits(hasMember, IntervalType, "start") &&
__traits(hasMember, IntervalType, "end")
) {}

Constructors

this
this(IntervalType i)

non-default ctor: construct Node from interval, update max side note: D is beautiful in that Node(i) will work just fine without this constructor since its first member is IntervalType interval, but we need the constructor to update max.

Members

Properties

key
auto key [@property getter]

sort key

Variables

balance
byte balance;

balance factor (signed, 8-bit)

interval
IntervalType interval;

must at a minimum include members start, end

max
typeof(IntervalType.end) max;

maximum in this subtree

p
IntervalTreeNode*[2] p;

0:left, 1:right

size
uint size;

#elements in subtree

Meta