(defun apply-left-rotations (node) (when node (when-bind right (right node) (when (> (height-diff node) 1) (if (< (node-height (right right)) (node-height (left right))) (setf node (double-rotate-left node)) (setf node (single-rotate-left node))))) node))Source Context