template class splaytree publicsplaytreenullnode new binarynodenullnode->left nullnode->right nullnoderoot nullnode~splaytreemakeempty)delete nullnode/same methods as for binarysearchtree (omittedsplaytreeconst splaytree rhs )splaytreesplaytree &rhs )splaytree operator=const splaytree rhs )splaytree operator=splaytree &rhs privatestruct binarynode /usual code for binary search tree nodes *}binarynode *rootbinarynode *nullnode/same methods as for binarysearchtree (omitted/tree manipulations void rotatewithleftchildbinarynode )void rotatewithrightchildbinarynode )void splayconst comparable xbinarynode )}figure splay treesclass interfaceconstructorand destructor we will repeatedly use this technique to simplify the code (and consequently make the code somewhat fasterfigure gives the code for the splaying procedure the header node allows us to be certain that we can attach to the largest node in without having to worry that might be empty (and similarly for the symmetric case dealing with