DEV Community

Discussion on: Building Deep Trees in JavaScript Using Object References

Collapse
 
0xviking profile image
0xViking

Can we create tree if there are few nodes with same id? for example 50 is root node, has child 40,30 and 40 has child 20,10 likewise 30 has child 60,70.
now the 20 node has child of 30,50 and 10 has child of 40,20.

in a nut shell:
node name -- children
50 - 40,30
40 - 20,10
30 - 60,70
20 - 30,50
10 - 40,20