Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

gizmo_mathboy (782)

gizmo_mathboy
  reversethis-{moc ... } {yobhtamomzig}

aerospace engineer by education, all-around walking cesspool of knowledge by nature, and professional grade slacker by choice. Sysadmin at a major midwestern university.
Tuesday March 26, 2002
04:40 PM

Let the healing begin

[ #3782 ]

I'm feeling much better than I have been. The mucus factory is pretty much closed. However, I seem to need to drink a heroic amount of water. I constantly feel parched. Must be the wintry weather.

It's still very nasty outside. I'm spending an awful amount of time inside for a Montana boy. Then again, I am getting over an illness and I'm getting pleny of work done.

Speaking of work, I didn't find much to help me with my hash tree problem. I found plenty of stuff about traversal and general graph theory but nothing that specifically helps me.

I think it boils down to doing a traversal. I have to run down the tree until I hit the bottom of a branch, check to see if that child is holding any data, if not delete it. Then go up to the parent of that child, if the parent has no children, then delete it. This goes on until have traversed the whole tree/hash.

Maybe I'll do some more research.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I think it boils down to doing a traversal. I have to run down the tree until I hit the bottom of a branch, check to see if that child is holding any data, if not delete it. Then go up to the parent of that child, if the parent has no children, then delete it. This goes on until have traversed the whole tree/hash.


    Why are there empty nodes there in the first place? Generally you shouldn't be creating an empty node and when you change a node it needs to be reinserted in its (possibly different) proper pla
    • What I'm doing is walking down the tree starting with the parent (it's for a defect tracking system). I see if the parent has any defects. I then go the the children and see if they have any defects and follow down in a depth-first traversal. I can't delete a node unless I know that all the children of it are empty (want to show the relationships).

                    1
                    |
                ---------------