Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Danias

Binary trees again!

This topic is 6420 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I kept fuzzing around with binary trees and there is one thing I don''t get. I want to create a GUI for my game and want to access nodes, in my case windows (WND), and controls (Ctrl). Now, picture this tree: GAME / \ / \ WND WND / \ -------- -------- / | \ | \ Ctrl Ctrl Ctrl Ctrl Ctrl Am I right to presume that the windows would be the nodes and the controls are the childs? If so, are the windows called siblings? I''m a linguistic problem here :-) Thanks! ;-)

Share this post


Link to post
Share on other sites
Advertisement
not sure if you''re talking about win32 programming, but from your diagram, the WND''s would be parents of the children, CTRL''s.

You said you wanted to access windows and controls, so just search down the tree for the node (they are all nodes) that you want.

Share this post


Link to post
Share on other sites
That''s not a binary tree, binary trees only have two children (at most).

The WND are also called branch nodes, and the ctrl are leaf nodes, Game is the root node.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!