Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Find opcode's reverse sibling?

by andyf (Pilgrim)
on Jun 12, 2004 at 18:59 UTC ( [id://363642]=note: print w/replies, xml ) Need Help??


in reply to Find opcode's reverse sibling?

Can you elaborate please Diotalevi. Some modern tree math terminology (badly) refers to 'siblings' and 'children' the same. You want to find to all nodes that share the same parent? That is what siblings are. If so the method you have, traverse to the parent and enumerate all children is optimal. In a B-Tree there will only be 2 possible children, so just the fact of having more than one link tells you a sibling exists. Node depth alone is not enough, it could be the evil twin on the other side of the tree.

Replies are listed 'Best First'.
Re^2: Find opcode's reverse sibling?
by diotalevi (Canon) on Jun 13, 2004 at 12:10 UTC

    You're on the wrong track. These terms are specific to perl's internal representation of compiled perl code. Here, children and siblings are separete things - siblings is a ordered, linked list of nodes that are children to a parent node. The linked list is constituted by a op_sibling pointer, the parent points to the first sibling with op_first, the last sibling with op_last and none of the middle ones. Sibling nodes do not point at any other sibling nodes except with the previously described op_sibling pointer.

    This is all about perl guts.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://363642]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-25 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found