Skip to content

Commit

Permalink
Update .travis.yml and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
joowani committed Aug 24, 2019
1 parent 035fec9 commit 08cec57
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
22 changes: 15 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
language: python
sudo: false
python:
- 2.7
- 3.4
- 3.5
- 3.6
language: python
matrix:
include:
- python: 2.7
- python: 3.4
- python: 3.5
- python: 3.6
- python: 3.7
dist: xenial
sudo: true
install:
- pip install flake8 mock pytest pytest-cov python-coveralls sphinx sphinx_rtd_theme
- pip install flake8 mock
- pip install pytest==3.5.1
- pip install pytest-cov==2.5.1
- pip install python-coveralls==2.9.1
- pip install sphinx sphinx_rtd_theme
- pip install .
script:
- python -m flake8
Expand Down
12 changes: 8 additions & 4 deletions binarytree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def _is_bst(root, min_value=float('-inf'), max_value=float('inf')):


def _is_symmetric(root):
"""Check if the binary tree is symmetric
"""Check if the binary tree is symmetric.
:param root: Root node of the binary tree
:param root: Root node of the binary tree.
:type root: binarytree.Node | None
:return: True if the binary tree is symmetric, False otherwise.
:rtype: bool
Expand Down Expand Up @@ -323,7 +323,7 @@ class Node(object):
current node and its descendants.
:param value: Node value (must be a number).
:type value: int | float
:type value: int | float | numbers.Number
:param left: Left child node (default: None).
:type left: binarytree.Node | None
:param right: Right child node (default: None).
Expand Down Expand Up @@ -1128,7 +1128,9 @@ def is_bst(self):
def is_symmetric(self):
"""Check if the binary tree is symmetric.
* Left subtree is a mirror of the right subtree around the center
A binary tree is symmetric if it meets the following criteria:
* Left subtree is a mirror of the right subtree about the root node.
:return: True if the binary tree is a symmetric, False otherwise.
:rtype: bool
Expand All @@ -1138,13 +1140,15 @@ def is_symmetric(self):
.. doctest::
>>> from binarytree import Node
>>>
>>> root = Node(1)
>>> root.left = Node(2)
>>> root.right = Node(2)
>>> root.left.left = Node(3)
>>> root.left.right = Node(4)
>>> root.right.left = Node(4)
>>> root.right.right = Node(3)
>>>
>>> print(root)
<BLANKLINE>
__1__
Expand Down
2 changes: 1 addition & 1 deletion binarytree/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.0.0' # pragma: no cover
__version__ = '4.1.0' # pragma: no cover

0 comments on commit 08cec57

Please sign in to comment.