vitoco has asked for the wisdom of the Perl Monks concerning the following question:
Monks, I'm trying to visualize the best method to handle the following:
I have a sorted array with many elements, and for some reason, I need to pull out a slice from that list and insert a placeholder which points to the location of the sub-list. I must do the same many times, both to the original list and to the new ones. In other words, I must construct a tree from a list, inserting elements where a new branch appears. When the special tree is finished, I have to traverse it in order, doing some actions based on the type of the node (original leaves vs new ones).
Should I use one of the available modules to handle trees, linked lists or such, or I must keep this simple by blessing some structures? Hints?
Thank you!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How might I handle a special tree?
by LanX (Saint) on Dec 07, 2014 at 22:19 UTC | |
by vitoco (Hermit) on Dec 07, 2014 at 22:57 UTC | |
by LanX (Saint) on Dec 07, 2014 at 23:02 UTC | |
by vitoco (Hermit) on Dec 07, 2014 at 23:34 UTC | |
|
Re: How might I handle a special tree?
by BrowserUk (Patriarch) on Dec 07, 2014 at 22:59 UTC | |
|
Re: How might I handle a special tree?
by Anonymous Monk on Dec 08, 2014 at 13:16 UTC | |
by Anonymous Monk on Dec 08, 2014 at 22:18 UTC | |
by vitoco (Hermit) on Dec 09, 2014 at 01:26 UTC | |
|
Re: How might I handle a special tree?
by vitoco (Hermit) on Dec 08, 2014 at 22:01 UTC | |
by Anonymous Monk on Dec 09, 2014 at 04:26 UTC |