????/****************************************************************
????*   ?????????findMax()
????*   ????????: ???????????
????*   ?????б?: ??
????*   ??????????
????*****************************************************************/
????template<typename Comparable>
????Comparable AvlTree<Comparable>::findMax() const
????{
????if(!isEmpty())
????return findMax(root);
????}
????/****************************************************************
????*   ?????????findMax(AvlNode * t)
????*   ????????: ???????????
????*   ?????б?: t?????????
????*   ??????????
????*****************************************************************/
????template<typename Comparable>
????Comparable AvlTree<Comparable>::findMax(AvlNode * t) const
????{
????if(t->right== NULL)
????return t->element;
????else
????return findMax(t->right);
????}
????/****************************************************************
????*   ?????????findMin()
????*   ????????: ?????????С?
????*   ?????б?: ??
????*   ??????????
????*****************************************************************/
????template<typename Comparable>
????Comparable AvlTree<Comparable>::findMin() const
????{
????if(!isEmpty())
????return findMin(root);
????}
????/****************************************************************
????*   ?????????findMin(AvlNode * t)
????*   ????????: ?????????С?
????*   ?????б?: t?????????
????*   ??????????
????*****************************************************************/
????template<typename Comparable>
????Comparable AvlTree<Comparable>::findMin(AvlNode * t) const
????{
????if(t->left == NULL)
????return t->element;
????else
????return findMin(t->left);
????}
????/****************************************************************
????*   ?????????~AvlTree()
????*   ????????: ????????????????????
????*   ?????б?: ??
????*   ??????????
????*****************************************************************/
????template<typename Comparable>
????AvlTree<Comparable>::~AvlTree()
????{
????makeEmpty();
????}
????/****************************************************************
????*   ?????????void insert(const Comparable & x)
????*   ????????: ??????x????
????*   ?????б?: x??????????
????*   ????????void
????*****************************************************************/
????template<typename Comparable>
????void AvlTree<Comparable>::insert(const Comparable & x)
????{
????insert(x?? root);
????}
????/****************************************************************
????*   ?????????void insert(const Comparable & x?? AvlNode * t)
????*   ????????: ????t??????????x????
????*   ?????б?: x??????????
????*             t????????
????*   ????????void
????*****************************************************************/
????template<typename Comparable>
????void AvlTree<Comparable>::insert(const Comparable & x?? AvlNode * & t)
????{
????if(t == NULL)//?????????
????t = new AvlNode(x?? NULL?? NULL);
????else if(x < t->element){
????insert(x?? t->left);
????if(height(t->left) - height(t->right) == 2){
????if(x < t->left->element)//??????????????
????rotateWithLeftChild(t);
????else
????doubleWithLeftChild(t);//?????????????
????}
????}
????else if(x > t->element){
????insert(x?? t->right);
????if(height(t->right) - height(t->left) == 2){
????if(x > t->right->element)//??????????????
????rotateWithRightChild(t);
????else
????doubleWithRightChild(t);//?????????????
????}
????}
????//???x??????????????????????????????????????????????????????????num?????????
????t->height = max(height(t->left)?? height(t->right)) + 1;//??????t????
????}