Design pattern for isomorphic trees
- by Peregring-lk
I want to create a data structure to work with isomorphic tree. I don't search for a "algorithms" or methods to check if two or more trees are isomorphic each other. Just to create various trees with the same structure.
Example:
2 - - - - - - - 'a' - - - - - - - 3.5
/ \ / \ / \
3 3 'f' 'y' 1.0 3.1
/ \ / \ / \
4 7 'e' 'f' 2.3 7.7
The first "layer" or tree is the "natural tree" (a tree with natural numbers), the second layer is the "character tree" and the third one is the "float tree".
The data structure has a method or iterator to traverse the tree and to make diferent operations with its values. These operations could change the value of nodes, but never its structure (first I create the structure and then I configure the tree with its diferent layers). In case of that I add a new node, this would be applied to each layer.
Which known design pattern fits with this description or is related with it?