[Solved] How to display a two dimensional array as a hierarchy table in java?


Create a class for Node, with a set of children, which are nodes as well, store the root Node(s). Implement method for insertion. Then implement the following algorithm:

  1. Find the elements, having null as parent, store them as root nodes.

  2. When a Node is created, find all its children and create them as children.

(Note, that whenever you add a child a Node was created).

Implement the display method, which traverses the tree in depth-first fashion and display each element as you like.

2

solved How to display a two dimensional array as a hierarchy table in java?