(defmethod node-insert ((node avl-tree-node) k val tree) (with-slots (key value left right) node (cond ((comp-= k key) (setf value val) node) ((comp-< k key) (setf left (node-insert left k val tree)) (apply-right-rotations (adjust-height node))) (t (setf right (node-insert right k val tree)) (apply-left-rotations (adjust-height node))))))Source Context