/*merge rhs into the priority queue rhs becomes empty rhs must be different from this exercise needed to make this operation more efficient *void mergebinomialqueue rhs ifthis =&rhs /avoid aliasing problems returncurrentsize +rhs currentsizeifcurrentsize capacityint oldnumtrees thetrees size)int newnumtrees maxthetrees size)rhs thetrees size thetrees resizenewnumtrees )forint oldnumtreesi newnumtrees++ thetreesi nullptrbinomialnode *carry nullptrforint <currentsize++ij * binomialnode * thetreesi ]binomialnode * rhs thetrees sizerhs thetreesi nullptrint whichcase =nullptr whichcase + =nullptr whichcase +carry =nullptr switchwhichcase case /no trees *case /only this *breakcase /only rhs *thetreesi rhs thetreesi nullptrbreakcase /only carry *thetreesi carrycarry nullptrbreakfigure routine to merge two priority queues