Skip to main content
gamedev.net
🔒 Locked

Double Binary Trees??

Started by Muncher 4 replies 550+ views
Original Post
Muncher
Muncher
Hey! I need to know what a double binary tree is. Does anyone know?? Any examples would be good (in C++/Java) Cheers Paul
LessBread
LessBread
dalleboy''s example looks good to me. Like I added in the other thread - I''m not sure such a thing exists by that name. "double binary" has an element of redundancy to it. Where did you hear that name? What was the context?
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
chris_graham
chris_graham
Doubally linked I''d guess. Links to chain back up the tree as well as chain down. But I''m not sure why someone would want to do that...
-----------------------------www.assimsoft.com
Fruny
Fruny
quote:
Original post by chris_graham
Doubally linked I''d guess. Links to chain back up the tree as well as chain down. But I''m not sure why someone would want to do that...


Non-recursive and stateless tree traversal.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
DrPizza
DrPizza
Parent pointers make all manner of operations more efficient, at the expense of one additional pointer per node.
char a[99999],*p=a;int main(int c,char**V){char*v=c>0?1[V]:(char*)V;if(c>=0)for(;*v&&93!=*v;){62==*v&&++p||60==*v&&--p||43==*v&&++*p||45==*v&&--*p||44==*v&&(*p=getchar())||46==*v&&putchar(*p)||91==*v&&(*p&&main(0,(char**)(--v+2))||(v=(char*)main(-1,(char**)++v)-1));++v;}else for(c=1;c;c+=(91==*v)-(93==*v),++v);return(int)v;} /*** drpizza@battleaxe.net ***/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.