Ticket #14498: trac_14498-typos-dg.patch

File trac_14498-typos-dg.patch, 7.6 KB (added by darij, 6 years ago)

not a review but just a fix for a couple typos. Jean-Baptiste, can you please look this over and qfold into your patch?

  • sage/combinat/abstract_tree.py

    # HG changeset patch
    # User darij grinberg <darijgrinberg@gmail.com>
    # Date 1373882103 25200
    # Node ID 1cf21a01ec051e16660f07a9bbfc57b9279edb77
    # Parent  db1599987dd58b219f8b46c6d1470fc8a36aebe1
    just some typos
    
    diff --git a/sage/combinat/abstract_tree.py b/sage/combinat/abstract_tree.py
    a b class AbstractTree(object): 
    117117
    118118    def pre_order_traversal_iter(self):
    119119        """
    120         The depth first pre-order traversal iterator
     120        The depth-first pre-order traversal iterator.
    121121
    122         This method iters each node following the depth first pre-order
     122        This method iters each node following the depth-first pre-order
    123123        traversal algorithm (recursive implementation).
    124124
    125         For example on the following binary tree `b`::
     125        For example, on the following binary tree `b`::
    126126
    127127            |   ___3____      |
    128128            |  /        \     |
    class AbstractTree(object): 
    132132            |        / \      |
    133133            |       4   6     |
    134134
    135         the ``depth first pre-order traversal algorithm`` explores `b` in the
    136         following order of nodes `3,1,2,7,5,4,6,8`.
     135        the ``depth-first pre-order traversal algorithm`` explores `b` in the
     136        following order of nodes: `3,1,2,7,5,4,6,8`.
    137137
    138138        The algorithm is::
    139139
    140             manipulate the root
    141             then explore each subtrees (by the algorithm)
     140            manipulate the root,
     141            then explore each subtree (by the algorithm).
    142142
    143         An other example::
     143        Another example::
    144144
    145145            |     __1____ |
    146146            |    /  /   / |
    class AbstractTree(object): 
    192192
    193193    def iterative_pre_order_traversal(self, action=lambda _: None):
    194194        """
    195         The depth first pre-order traversal algorithm (iterative
    196         implementation)
     195        The depth-first pre-order traversal algorithm (iterative
     196        implementation).
    197197
    198198        INPUT:
    199199
    200200        - ``action`` -- a specific function which takes a node in input and do
    201         something during the exploration.
     201          something during the exploration.
    202202
    203203        (see :meth:`pre_order_traversal_iter
    204204        <sage.combinat.abstract_tree.AbstractTree.pre_order_traversal_iter>`
    class AbstractTree(object): 
    247247
    248248    def pre_order_traversal(self, action=lambda _: None):
    249249        """
    250         The depth first pre-order traversal algorithm (recursive
     250        The depth-first pre-order traversal algorithm (recursive
    251251        implementation)
    252252
    253253        INPUT:
    class AbstractTree(object): 
    265265            |        / \      |
    266266            |       4   6     |
    267267
    268         the ``depth first pre-order traversal algorithm`` explores `b` in the
     268        the ``depth-first pre-order traversal algorithm`` explores `b` in the
    269269        following order of nodes `3,1,2,7,5,4,6,8`.
    270270
    271271        The algorithm is::
    272272
    273             manipulate the root with function `action`
     273            manipulate the root with function `action`,
    274274            then explore each subtrees (by the algorithm)
    275275
    276         An other example::
     276        Another example::
    277277
    278278            |     __1____ |
    279279            |    /  /   / |
    class AbstractTree(object): 
    332332
    333333    def post_order_traversal_iter(self):
    334334        """
    335         The depth first post-order traversal iterator
     335        The depth-first post-order traversal iterator
    336336
    337         This method iters each node following the depth first post-order
     337        This method iters each node following the depth-first post-order
    338338        traversal algorithm (recursive implementation).
    339339
    340340        For example on the following binary tree `b`::
    class AbstractTree(object): 
    347347            |        / \      |
    348348            |       4   6     |
    349349
    350         the ``depth first post-order traversal algorithm`` explores `b` in the
     350        the ``depth-first post-order traversal algorithm`` explores `b` in the
    351351        following order of nodes `2,1,4,6,5,8,7,3`.
    352352
    353353        The algorithm is::
    class AbstractTree(object): 
    413413
    414414    def post_order_traversal(self, action=lambda node: None):
    415415        """
    416         The depth first post-order traversal algorithm (recursive
     416        The depth-first post-order traversal algorithm (recursive
    417417        implementation)
    418418
    419419        INPUT:
    class AbstractTree(object): 
    457457
    458458    def iterative_post_order_traversal(self, action=lambda node: None):
    459459        """
    460         The depth first post-order traversal algorithm (iterative
     460        The depth-first post-order traversal algorithm (iterative
    461461        implementation)
    462462
    463463        INPUT:
    class AbstractTree(object): 
    512512
    513513    def breadth_first_order_traversal(self, action=lambda node: None):
    514514        """
    515         The breadth first order traversal algorithm.
     515        The breadth-first order traversal algorithm.
    516516
    517517        INPUT:
    518518
    519519        - ``action`` -- a specific function which takes a node in input and do
    520         something during the exploration.
     520          something during the exploration.
    521521
    522         For example on the following binary tree `b`::
     522        For example, on the following binary tree `b`::
    523523
    524524            |   ___3____      |
    525525            |  /        \     |
    class AbstractTree(object): 
    529529            |        / \      |
    530530            |       4   6     |
    531531
    532         the ``breadth first order traversal algorithm`` explores `b` in the
    533         following order of nodes `3,1,7,2,5,8,4,6`.
     532        the ``breadth-first order traversal algorithm`` explores `b` in the
     533        following order of nodes: `3,1,7,2,5,8,4,6`.
    534534
    535535        The algorithm is::
    536536
  • sage/combinat/binary_tree.py

    diff --git a/sage/combinat/binary_tree.py b/sage/combinat/binary_tree.py
    a b class BinaryTree(AbstractClonableTree, C 
    976976
    977977    def in_order_traversal_iter(self):
    978978        """
    979         The depth first infix-order traversal iterator.
     979        The depth-first infix-order traversal iterator.
    980980
    981981        This method iters each node following the infix order traversal
    982982        algorithm.
    class BinaryTree(AbstractClonableTree, C 
    994994            |         / \   / \      |
    995995            |        d   e f   g     |
    996996
    997         the ``depth first infixe-order traversal algorithm`` explores `T` in
     997        the ``depth-first infixe-order traversal algorithm`` explores `T` in
    998998        the following order of nodes `a,1,b,2,c,3,d,4,e,5,f,6,g,7,h,8,i`.
    999999
    10001000        The algorithm::
    class BinaryTree(AbstractClonableTree, C 
    10451045            node_action=lambda _: None,
    10461046            leaf_action=lambda _: None):
    10471047        r"""
    1048         The depth first infix-order traversal algorithm.
     1048        The depth-first infix-order traversal algorithm.
    10491049
    10501050        (see :meth:`in_order_traversal_iter
    10511051        <sage.combinat.binary_tree.BinaryTree.in_order_traversal_iter>`
    class BinaryTree(AbstractClonableTree, C 
    13041304        .. MATH::
    13051305
    13061306            f_{q} (T) = \\frac{[\\mid T\\mid]_q !}{\\prod_{t\\in T}
    1307             q^{right(t)}[\\mid t\\mid]_q}
     1307            q^{right(t)}\\mid t\\mid]_q}
    13081308
    13091309        where `\\mid T\\mid` is the node number of `T`, `t\\in T` the set
    1310         of all subtree of `T` and `right(t)` the number of node of the right
    1311         subtree of `t`.
     1310        of all subtrees of `T`, and `right(t)` the number of nodes of the
     1311        right subtree of `t`.
    13121312
    1313         There is 20 permutations which give this shape binary tree::
     1313        There are `20` permutations which give a binary tree of the
     1314        following shape::
    13141315
    13151316            |     __o__   |
    13161317            |    /     \  |