3 ms·
Intervals can only be "based" on ordered pairs of things with a total ordering and a finite computer representation, of which integers (trivially) and dates (on
by HelloNurse 10y ago
Intervals can only be "based" on ordered pairs of things with a total ordering and a finite computer representation, of which integers (trivially) and dates (only if represented with adequate constraints) are only two examples.
If a generic implementation of interval trees is not possible, the programming language is (deliberately) simplified, for the sake of stupid users or stupid implementations. Note that this is a very low bar: in C interval extremes can be void* and their total ordering can be represented as a function pointer int (f)(void,void*), while in old Java the interval tree could refer to a suitable "Element" interface, leaving cumbersome adapters and downcasts to client code.