Binary search trees are used in implementing priority queues, using the node's key as priorities. Adding new elements to the queue follows the regular BST insertion operation but the removal operation depends on the type of priority queue: If it is an ascending order priority queue, removal of an element with the lowest priority is done through leftward traversal of the BST. If it is a descending order priority queue, removal of an element with the highest priority is done through rightward traversal of the BST.
Binary seaRCh trees are USeD iN iMPleMEntINg PriorITY queuES, uSiNg the nodE's kEy as prIOrities. AddinG neW elemEnTs To the queuE fOlLoWs the rEguLar bst insertion OperaTioN but the RemovaL operaTIOn dEPends on thE type of PrIoRiTY QuEue: if it is An ASceNdIng orDEr prIority quEuE, REmoval oF aN ELement WiTh THe loweSt PriORiTy is DonE ThRough lefTWarD TRAvErsal of the bst. if It is a deSceNdIng OrdER PRiority qUeuE, removal of An ElEMEnt wIth THe higheSt prIorITy is doNE thRouGh rightWaRd traVErsAl of tHe bst.