Skip to content

Shows an embedded tree in output console from given node relations

Notifications You must be signed in to change notification settings

ajayat/tree-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A beautiful C++ tree generator

It can be printed directly on the output console :

              ┌ Epsilon
              ├─── Zeta
      ┌─ Beta ┤
      │       ├──── Eta
      │       │         ┌───── Mu
      │       └── Theta ┤
      │                 └───── Nu
Alpha ┼ Gamma ────── Xi ─ Omicron
      │       ┌─── Iota
      └ Delta ┼── Kappa
              └─ Lambda

You can define relations between nodes in the edges.json file.

{
  "Alpha": {
    "Beta": {
      "Epsilon": {},
      "Zeta": {},
      "Eta": {},
      "Theta": {
        "Mu": {},
        "Nu": {}
      }
    },
    "Gamma": {
      "Xi": {
        "Omicron": {}
      }
    },
    "Delta": {
      "Iota": {},
      "Kappa": {},
      "Lambda": {}
    }
  }
}

You can also use your own tree representation, the Tree class needs only an adjacency table to work:

int main() {
    ...
    Tree(adjacences).show(root);
}

Made by Adrien Jayat.

About

Shows an embedded tree in output console from given node relations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages