template class treap publictreapnullnode new treapnodenullnode->left nullnode->right nullnodenullnode->priority int_maxroot nullnodetreapconst treap rhs )treaptreap &rhs )~treap)treap operator=const treap rhs )treap operator=treap &rhs )/additional public member functions (not shownprivatestruct treapnode comparable elementtreapnode *lefttreapnode *rightint prioritytreapnodeleftnullptr }rightnullptr }priorityint_max treapnodeconst comparable etreapnode *lttreapnode *rtint pr elemente }leftlt }rightrt }prioritypr treapnodecomparable &etreapnode *lttreapnode *rtint pr elementstd::movee }leftlt }rightrt }prioritypr }treapnode *roottreapnode *nullnodeuniformrandom randomnums/additional private member functions (not shown}figure treap class interface and constructor