Nary Tree Widget

An n-ary tree is the extension of a binary tree, where a parent node can have ‘n’ number of child nodes. Add n-ary trees (data structure) using the ‘Nary Tree widget’.

We'll cover the following

This is what it looks like:

What do I need to know?

  • With the “+Left Sibling” button, you can add a new sibling to the left side of the selected node. This button is disabled for the root because it can not have the left sibling.

  • With the “Right Sibling+” button, you can add a new sibling to the right side of the selected node. This button is disabled for the root because it can not have the right sibling.

  • With the “Child Node” button, you can add a single child node to the selected node. If you want to add more children to a particular node, select its child node and increase the number of siblings as you see fit.

  • You can change the value or color of a node.

    • Click the node and specify the label/text in the text field.

    • Click the node and use the color picker to change the color.

  • You can select the node and click the trash icon to delete it.

See the image below for reference.