hexlet-graphs


License
ISC
Install
pip install hexlet-graphs==0.1.3

Documentation

python-graphs

github action status

Install

pip install hexlet-graphs

Usage example

from hexlet.fs import (
  build_tree_from_leaf
  make_joints,
  sortTree
)

tree = ['B', [
    ['D'],
    ['A', [
        ['C', [
            ['F'],
            ['E'],
        ]],
    ]],
]]

joints = make_joints(tree)
transformed = build_tree_from_leaf(joints)
# ['C', [
#     ['F'],
#     ['E'],
#     ['A', [
#         ['B', [
#             ['D'],
#         ]],
#     ]],
# ]]

sort_tree(transformed)
# ['C', [
#     ['A', [
#         ['B', [
#             ['D'],
#         ]],
#     ]],
#     ['E'],
#     ['F'],
# ]]

For more information, see the Full Documentation

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet (in Russian).

See most active contributers on hexlet-friends.