advanced data structures and implementation void deleteminifisemptythrow underflowexception}pairnode *oldroot rootifroot->leftchild =nullptr root nullptrelse root combinesiblingsroot->leftchild )delete oldrootfigure pairing heap deletemin scan with the current merged result as an exampleif we have eight childrenc through the first scan performs the merges and and and and and as resultwe obtain and we perform the second pass by merging and is then merged with that resultand then is merged with the result of the previous merge our implementation requires an array to store the subtrees in the worst casen items could be children of the rootbut declaring (non-staticarray of size inside of combinesiblings would give an (nalgorithm so we use single expanding array instead because it is staticit is reused in each callwithout the overhead of reinitialization other merging strategies are discussed in the exercises the only simple merging strategy that is easily seen to be poor is left-to-right single-pass merge (exercise the pairing heap is good example of "simple is betterand seems to be the method of choice for serious applications requiring the decreasekey or merge operation summary in this we've seen several efficient variations of the binary search tree the top-down splay tree provides (log namortized performancethe treap gives (log nrandomized performanceand the red-black tree gives (log nworst-case performance for the basic operations the trade-offs between the various structures involve code complexityease of deletionand differing searching and insertion costs it is difficult to say that any one structure is clear winner recurring themes include tree rotations and the use of sentinel nodes to eliminate many of the annoying tests for nullptr that would otherwise be necessary the suffix tree and array are powerful data structure that allows quick repeated searching for fixed text the - tree provides practical method for performing range searcheseven though the theoretical bounds are not optimal finallywe described and coded the pairing heapwhich seems to be the most practical mergeable priority queueespecially when decreasekey operations are requiredeven though it is theoretically less efficient than the fibonacci heap