Loading tutorials
Intermediate · Mid: 17 chapters · 35 min read. States assumed prerequisites
Start reading(low, high) with low <= high. All intervals here are closed, so both endpoints belong to the interval.a[0] <= b[1] and b[0] <= a[1].a and b overlap when a[0] <= b[1] and b[0] <= a[1].max field holds the largest high endpoint in that node's subtree.(lo, hi). The tree is ordered by lo. Each node's max field holds thefind_overlap loop. Here we prove that the loop is correct.max is the largest high endpoint in its subtree. You should also know the single-result search. Here you extend that search to return every overlapping intermax field of every node whose subtree changed.max field, and the tree is ordered by low endpoint. Here n is the number of stored intervals, h is the tree height, and k is the number of ininsert, and find_overlap. It shows where that structure pays off and how to recognize the problems it fits.