moved SwapChildren function from avltree to binarytree