i'm search a solution for the following task:
i have a flat list with a lot of data.
Now i want to transfrom this list into an tree with the following rules:
- all of my listitems should be leafs
- the number of nodes per tree depth should be limit the a certain limit
- nodes can be nested with unlimited depth
i think it's like an k-ary (with k is the node limit per level) tree, but maybe this thing has annother name.
The background for this task is a visualisation problem of my list in a radial tree. Displaying all leafs on the first level in the radial tree doesn't look good when there are too much. So i think it's better to insert some nodes to group my data when the level limit is reached. The resulting tree should be able to display the leafs in a better visually way.
is there an algorithm or even better an implementation for this task?
Thanks for any pointer or infos.
klimit the total number of nodes at a level? K-ary means k child nodes per internal node (no per-level limit) which is a different thing.