def getPrecedence(operator):
    """
    Returns the precedence for operators for use in toReversePolish(), where high numbers represent greater precedence
    :param operator: operator token data
    :return: number representing the precedence of the given operator
    """
    if operator == "^":
        return 3
    elif operator in ["*","/"]:
        return 2
    elif operator in ["+","-"]:
        return 1