Results 1 to 5 of 5
- 08-04-2012, 09:42 PM #1
Member
- Join Date
- Aug 2012
- Posts
- 3
- Rep Power
- 0
Should a 234 tree Nodes link to their parent as well as their children?
When Implementing a 234 tree should the Nodes link to their parent as well as their children or should they link only to their children? I know that how i do it is ultimately up to me. But in practice (in your experience) do they normally link back to their parent?
- 08-05-2012, 01:53 AM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Re: Should a 234 tree Nodes link to their parent as well as their children?
- 08-05-2012, 06:32 AM #3
Member
- Join Date
- Aug 2012
- Posts
- 3
- Rep Power
- 0
Re: Should a 234 tree Nodes link to their parent as well as their children?
Sorry I didn't realize cross posting was prohibited, I guess now I know.
- 08-05-2012, 08:04 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: Should a 234 tree Nodes link to their parent as well as their children?
When you traverse the tree downwards (i.e. away from the root) you can push the visited nodes on a stack; that way you don't need to keep pointers to the parents when you want to crawl back again (i.e. towards the root). But it doesn't harm to store a parent pointer in each node.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 08-06-2012, 06:51 AM #5
Member
- Join Date
- Aug 2012
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
adding children to a node that has List of Nodes
By f1gh in forum New To JavaReplies: 0Last Post: 11-29-2010, 01:27 AM -
How to keep track of nodes in a tree?
By ryuzog in forum New To JavaReplies: 2Last Post: 11-25-2010, 11:30 PM -
How do I determine the height of nodes in a AVL tree?
By ryuzog in forum New To JavaReplies: 2Last Post: 11-09-2010, 01:34 PM -
Adding/removing nodes to tree under TreeViewer
By Rodrigo Braz in forum SWT / JFaceReplies: 0Last Post: 04-20-2009, 01:02 AM -
OrgCart problem:how retreive all children of a parent
By mtz1406 in forum JDBCReplies: 2Last Post: 12-12-2008, 10:48 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks