TreeSearch(k,v,T) (0) if v is external (1) return NULL (2) if k = key(v) (3) return v (4) if k < key(v) (5) return TreeSearch(k,T.leftChild(v),T) (6) else (7) return TreeSearch(k,T.rightChild(v),T)
Insert(v,k,e,T) (0) if k < T.element(v) (1) if T.isNull(T.leftChild(v)) (2) T.AddLeftChld(v,k,e) (3) else (4) Insert(T.leftChild(v),k,e,T) (5) else if T.isNull(T.rightChild(v)) (6) T.AddRightChild(v,k,e) (7) else (8) Insert(T.rightChild(v),k,e,T)
(0) If T.isNull(T.root()) (1) T.AddRoot(k,e) (2) else (3) Insert(T.root(),k,e,T)
itemType DeleteMin(v, T) (0) if isNull(T.leftChld(v)) (1) tmp = T.element(v) (2) replace v with right child of v (3) return tmp (4) else (5) return DeleteMin(T.leftchild(v),T)
Delete(v, k, T) (0) if !T.isNull(v) (1) if k < T.element(v) (2) Delete(T.leftChild(v),k,T) (3) else if k > T.element(v) (4) Delete(T.rightChild(v),k, T) (5) else if T.isNull(T.leftChild(v)) and T.isNull(T.rightChild(v)) (6) remove node v (7) else if T.isNull(T.leftChild(v) (8) replace v with the right child of v (9) else if T.isNull(T.rightChild(v) (10) replace v with the left child of v (11) else (12) T.replaceElement(v,DeleteMin(T.rightChild(v),T))