def _traverse_tree_(self, payoffs):
        for i in reversed(range(self.N)):
            payoffs = (payoffs[:-2] * self.qu +
                       payoffs[1:-1] * self.qm +
                       payoffs[2:] * self.qd) * self.df

            if not self.is_european:
                payoffs = self.__check_early_exercise__(payoffs,
                                                        i)

        return payoffs
Traverse the tree backwards
dataset/ETHPy150Open jamesmawm/Mastering-Python-for-Finance-source-codes/B03898_04_codes/TrinomialTreeOption.py/TrinomialTreeOption._traverse_tree_