$b<x<c,\forall b\in B,\forall c\in C.$ |
$a<b<x<c<d,\forall a\in A,\forall b\in B,\forall c\in C,\forall d\in D.$ |
def tree_predecessor(x): if left[x] != NIL: return tree_maximum(left[x]) z = x y = parent[z] while y != NIL and z == left[y]: z = y y = parent[y] return y
def link(x, y): if rank[x] > rank[y]: p[y] = x else p[x] = y if rank[x] == rank[y]: rank[y] = rank[y] + 1
def find_set(x): if x != p[x]: p[x] = find_set(p[x]) return p[x]