Here are two samples of the tree structure. The common tree allows repeatable values, the unique tree not allows.
There is the ability to set traversing type: in-depth or in-width.
Here are two samples of the tree structure and an ability to set traversing type in-depth or in-width
Java