Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 3 committers (66.7%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.1%) to scientific vocabulary
Last synced: 11 months ago
·
JSON representation
Repository
Draw binary tree in plain text
Basic Info
- Host: GitHub
- Owner: msbanik
- Language: Python
- Default Branch: master
- Size: 23.4 KB
Statistics
- Stars: 68
- Watchers: 2
- Forks: 15
- Open Issues: 6
- Releases: 0
Created almost 11 years ago
· Last pushed over 2 years ago
Metadata Files
Readme
README.rst
drawtree
========
.. image:: https://img.shields.io/pypi/v/drawtree.svg?style=flat-square&label=latest%20version
:target: https://pypi.python.org/pypi/drawtree
:alt: Latest PyPI version
Draw binary tree in plain text
Usage
-----
Draw tree from level order traversal, '#' signifies a path terminator where no node exists below.
.. code-block:: python
from drawtree import draw_level_order
draw_level_order('{3,9,20,#,#,15,7}')
::
3
/ \
9 20
/ \
15 7
Draw random binary search tree
.. code-block:: python
from drawtree import draw_random_bst
draw_random_bst(10)
::
64
/ \
/ \
4 66
\ \
37 70
/ \
8 51
/ \
6 12
\
21
Draw binary search tree from integer array
.. code-block:: python
from drawtree import draw_bst
nums = [55, 30, 10, 5, 2, 20, 15, 25, 40, 35, 70, 60, 80, 75, 95]
draw_bst(nums)
::
55
/ \
/ \
/ \
/ \
30 70
/ \ / \
/ \ / \
/ \ 60 80
10 40 / \
/ \ / / \
/ \ 35 75 95
5 20
/ / \
2 / \
15 25
Command line
------------
Flags:
-p, --preorder interpet sequence as preorder
-b, --balanced auto balance bst
-l, --level-order interpet sequence as level-order
Print a bst:
.. code-block:: bash
$ bst 10 5 8 4 6
$ bst nodes.txt
$ echo "colin eric dave" | bst
$ cat nodes.txt | sort | uniq | bst
Print a balanced bst:
.. code-block:: bash
$ bst -b 10 5 6 9 3
$ bst -b nodes.txt
$ bst -b < nodes.txt
Print a bst from a preorder expression:
.. code-block:: bash
$ bst -p dave colin dan
$ echo "1 2 3 4 5" | bst -p
$ bst -p nodes.txt
Print a binary tree from a level order expression:
.. code-block:: bash
$ bst -l [4,#,7,5,9,#] (leetcode format)
$ bst -l {4 # 7 5}
Print a random bst:
.. code-block:: bash
$ bst (random bst of 10 nodes)
$ bst 5 (random bst of 5 nodes)
$ bst -b 7 (random balanced bst of 7 nodes)
Installation
------------
To install drawtree, simply:
.. code-block:: bash
$ pip install drawtree
Licence
-------
MIT
Reference
---------
`Draw tree `_
Authors
-------
`drawtree` was written by `Madhusudan Banik `_.
Owner
- Name: Madhusudan Banik
- Login: msbanik
- Kind: user
- Location: Seattle, WA
- Website: http://msbanik.com
- Repositories: 29
- Profile: https://github.com/msbanik
Software Engineer @Microsoft , former @Nokia
GitHub Events
Total
Last Year
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Madhusudan Banik | m****k@g****m | 7 |
| joncrall | c****j@r****u | 3 |
| Eric Pratt | e****t@m****u | 1 |
Committer Domains (Top 20 + Academic)
mymail.lccc.edu: 1
rpi.edu: 1
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 6
- Total pull requests: 4
- Average time to close issues: 22 days
- Average time to close pull requests: 2 months
- Total issue authors: 6
- Total pull request authors: 4
- Average comments per issue: 0.5
- Average comments per pull request: 0.5
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- AlJohri (1)
- deb17 (1)
- greekatos (1)
- 01joy (1)
- zodman (1)
- hotea (1)
Pull Request Authors
- leoxanigm (2)
- Erotemic (1)
- Pratted (1)
- renxida (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 21 last-month
- Total dependent packages: 0
- Total dependent repositories: 2
- Total versions: 2
- Total maintainers: 1
pypi.org: drawtree
Draw binary tree in plain text
- Homepage: https://github.com/msbanik/drawtree.git
- Documentation: https://drawtree.readthedocs.io/
- License: MIT
-
Latest release: 0.1.2
published over 8 years ago
Rankings
Stargazers count: 8.4%
Forks count: 9.3%
Dependent packages count: 10.0%
Average: 10.8%
Dependent repos count: 11.6%
Downloads: 14.5%
Maintainers (1)
Last synced:
11 months ago
Dependencies
setup.py
pypi