public void cross(Equation other) {
        //Pick random Nodes from both equations to serve as the roots of the cross
        Node swap = getRandomNode();
        Node swapOther = other.getRandomNode();

        //Get the parents of the swap Nodes in order
        Node parent, parentOther;
        parent = swap.getParent();
        parentOther = swapOther.getParent();

        //Determine if the swap Nodes are the left, middle, or right children of their parents in order to update the
        // left/middle/right pointers of the parents. If they do not have parents, this is unnecessary.
        if (parent != null) {
            boolean isLeft, isMiddle;
            isLeft = (swap == parent.getLeft());
            isMiddle = (swap == parent.getMiddle());

            if (isLeft) {
                parent.setLeft(swapOther);
            }
            else if (isMiddle) {
                parent.setMiddle(swapOther);
            }
            else {
                parent.setRight(swapOther);
            }
        }
        if (parentOther != null) {
            boolean otherIsLeft, otherIsMiddle;
            otherIsLeft = (swapOther == parentOther.getLeft());
            otherIsMiddle = (swapOther == parentOther.getMiddle());

            if (otherIsLeft) {
                parentOther.setLeft(swap);
            }
            else if (otherIsMiddle) {
                parentOther.setMiddle(swap);
            }
            else {
                parentOther.setRight(swap);
            }
        }

        //Swap the parents of the two swap Nodes
        swap.setParent(parentOther);
        swapOther.setParent(parent);

        //Update the list of Nodes in the expression tree
        trace();
        //Update the infix expression of the modified expression tree
        updateExpression();
    }