Skip to main content

Module created to facilitate the creation and use of data structures

Project description

datastructs

Module created to facilitate the creation and use of data structures

Build Status Updates Python 3

Installation

pipenv install datastructs

How to Use

Binary Tree

>>> from datastructs import BinaryTree
>>> binary_tree = BinaryTree([1, 2, 3, 4])
>>> binary_tree.print()
1 2 3 4 
>>> binary_tree.add([5, 6, 7, 8])
>>> binary_tree.print()
1 2 3 4 5 6 7 8 
>>> binary_tree.print('pre')
1 2 4 6 8 7 5 3 
>>> binary_tree.print('in')
8 6 4 7 2 5 1 3 
>>> binary_tree.print('pos')
8 6 7 4 5 2 3 1 

Linked List

>>> from datastructs import LinkedList
>>> linked_list = LinkedList([1, 2, 3, 4])
>>> linked_list.print()
1->2->3->4
>>> linked_list.add([5, 6, 7, 8])
>>> linked_list.print()
1->2->3->4->5->6->7->8

How to contribute

All code follows PEP8, except for the line length, which accepts 120 characters.

  1. Make the project fork and clone the project: git clone git@github.com:<your_user>/datastructs.git
  2. Install pipenv: pip install pipenv
  3. Install the dependencies for dev: pipenv install -d
  4. Develop the feature with tests
  5. Run the tests locally: pipenv run pytest
  6. Send the pull request with tests in a single commit
  7. Submit the PR for review
  8. After reviewed and corrected, the PR will be accepted and the lib post in PyPi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datastructs-0.2.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file datastructs-0.2.tar.gz.

File metadata

  • Download URL: datastructs-0.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for datastructs-0.2.tar.gz
Algorithm Hash digest
SHA256 f80f28b380ddee83f138e32c9963a84ee3c4d186dc26f9469dd3ec460ddccc1d
MD5 2c03381b626c1e3f3be9eddbfd13c870
BLAKE2b-256 fdf3fee85ea397518f9bd4599cb4abb130530751c1d283c5d90b36fe55f84bdd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page