@@ -376,10 +376,10 @@ def __str__(self):
376376
377377 .. note::
378378
379- To include `level-order (breath -first)`_ indexes in the string, use
380- :func:`binarytree.Node.pprint` instead.
379+ To include `level-order (breadth -first)`_ indexes in the string,
380+ use :func:`binarytree.Node.pprint` instead.
381381
382- .. _level-order (breath -first):
382+ .. _level-order (breadth -first):
383383 https://en.wikipedia.org/wiki/Tree_traversal#Breadth-first_search
384384 """
385385 lines = _build_tree_string (self , 0 , False , '-' )[0 ]
@@ -509,7 +509,7 @@ def __len__(self):
509509 return self .properties ['size' ]
510510
511511 def __getitem__ (self , index ):
512- """Return the node/subtree at the give `level-order (breath -first)`_
512+ """Return the node/subtree at the give `level-order (breadth -first)`_
513513 index.
514514
515515 :param index: The node index.
@@ -521,7 +521,7 @@ def __getitem__(self, index):
521521 :raise binarytree.exceptions.NodeNotFoundError:
522522 If the target node does not exist.
523523
524- .. _level-order (breath -first):
524+ .. _level-order (breadth -first):
525525 https://en.wikipedia.org/wiki/Tree_traversal#Breadth-first_search
526526
527527 **Example**:
@@ -578,7 +578,7 @@ def __getitem__(self, index):
578578
579579 def __setitem__ (self , index , node ):
580580 """Insert the node/subtree into the binary tree at the given
581- `level-order (breath -first)`_ index.
581+ `level-order (breadth -first)`_ index.
582582
583583 * An exception is raised if the parent node does not exist.
584584 * Any existing node/subtree is overwritten.
@@ -595,7 +595,7 @@ def __setitem__(self, index, node):
595595 :raise binarytree.exceptions.InvalidNodeTypeError:
596596 If the new node is not an instance of :class:`binarytree.Node`.
597597
598- .. _level-order (breath -first):
598+ .. _level-order (breadth -first):
599599 https://en.wikipedia.org/wiki/Tree_traversal#Breadth-first_search
600600
601601 **Example**:
@@ -651,7 +651,7 @@ def __setitem__(self, index, node):
651651 setattr (parent , 'left' if index % 2 else 'right' , node )
652652
653653 def __delitem__ (self , index ):
654- """Remove the node/subtree at the given `level-order (breath -first)`_
654+ """Remove the node/subtree at the given `level-order (breadth -first)`_
655655 index from the binary tree.
656656
657657 * An exception is raised if the target node does not exist.
@@ -665,7 +665,7 @@ def __delitem__(self, index):
665665 :raise binarytree.exceptions.NodeNotFoundError:
666666 If the target node or its parent does not exist.
667667
668- .. _level-order (breath -first):
668+ .. _level-order (breadth -first):
669669 https://en.wikipedia.org/wiki/Tree_traversal#Breadth-first_search
670670
671671 **Example**:
@@ -718,7 +718,7 @@ def pprint(self, index=False, delimiter='-'):
718718 """Pretty-print the binary tree.
719719
720720 :param index: If set to True (default: False), display the
721- `level-order (breath -first)`_ indexes using the following
721+ `level-order (breadth -first)`_ indexes using the following
722722 format: "{index}{delimiter}{value}".
723723 :type index: bool
724724 :param delimiter: The delimiter character between the node index, and
@@ -1547,9 +1547,9 @@ def postorder(self):
15471547 @property
15481548 def levelorder (self ):
15491549 """Return the nodes in the binary tree using
1550- `level-order (breath -first)`_ traversal.
1550+ `level-order (breadth -first)`_ traversal.
15511551
1552- .. _level-order (breath -first):
1552+ .. _level-order (breadth -first):
15531553 https://en.wikipedia.org/wiki/Tree_traversal#Breadth-first_search
15541554
15551555 :return: The list of nodes.
@@ -1596,13 +1596,13 @@ def levelorder(self):
15961596
15971597def build (values ):
15981598 """Build a binary tree from a `list representation`_ (i.e. a list of
1599- node values and/or None's in breath -first order) and return its root.
1599+ node values and/or None's in breadth -first order) and return its root.
16001600
16011601 :param values: The list representation (i.e. a list of node values and/or
1602- None's in breath -first order). If a node has an index i, its left child
1603- is at index 2i + 1, right child at index 2i + 2, and parent at index
1604- floor((i - 1) / 2). None signifies the absence of a node. See example
1605- below for an illustration.
1602+ None's in breadth -first order). If a node has an index i, its left
1603+ child is at index 2i + 1, right child at index 2i + 2, and parent at
1604+ index floor((i - 1) / 2). None signifies the absence of a node. See
1605+ example below for an illustration.
16061606 :type values: [int | None]
16071607 :return: The root of the binary tree.
16081608 :rtype: binarytree.Node
0 commit comments