Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sutree

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sutree

Tree data structure library

  • 0.2.0
  • PyPI
  • Socket score

Maintainers
1

SUTREE

DESCRIPTION

Tree data structure library with great display utility.

 

AUTHOR

Thanh Trung Nguyen

  • Email: thanh.it1995@gmail.com
  • Facebook: https://www.facebook.com/thanh.it95

 

INSTALLATION

pip install sutree

 

FEATURES

This package includes two libraries:

  • Tree library.
  • Tree display library.

Tree library:

  • Various types of trees: Binary Tree, Binary Search Tree, AVL Tree.
  • Regular operations:
    • Checking empty.
    • Getting number of nodes.
    • Getting height.
    • Traversal:
      • 3 options: pre-order, in-order, post-order.
      • 2 modes: recursive traversal and non-recursive traversal.
    • Checking existence of a key.
    • Getting minimum key.
    • Getting maximum key.
    • Insertion.
    • Removal.
    • Constructing from a list.

Note: In the future, I will update more trees.

Tree display library:

  • It can config space between 2 branch neighbors.
  • It can config precision of floating-point numbers.
  • It accepts any type of key of node. Just makes sure key is convertible to string.
  • It accepts any structure of node, which is high flexibily.
  • It can config left margin.
  • It outputs to:
    • a string, or...
    • a list of rows.

Output example generated by this utility:

Output example 1:

                       100
                        |
             -----------------------
             50                  70000
             |                     |
       -------------        ----------------
       10        88.52    20000          90000
       |           |        |
   ---------    ----     --------
-123456  14.78  62      500  30000.19
                                |
                                -----
                                  40000

Output example 2:

               func_definition
                      |
 -------------------------------------------
 |          |          |         |         |
def     func_name      (      arg_list     )
            |                    |
      sum_2_integers        -----------
                            |    |    |
                           arg   ,   arg
                            |         |
                           foo       bar

 

TUTORIALS

There are two sections of tutorials:

  • Tree: Using pre-defined trees in library such as BinaryTree, AvlTree...
    • Take a look at /test/tree_.
  • Display: Display a tree.

 

CODE STRUCTURE

Update later.

 

PROJECT SPECIFICATIONS

  • Language: Python 3.8
  • Paradigms: object-oriented, procedural

 

LICENSE

Copyright (c) Thanh Trung Nguyen.

This project is licensed under the 3-Clause BSD License.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc