home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 14,622 of 14,669   
   Skybuck Flying to All   
   Re: Translate BinaryTree Node Number to    
   17 Feb 23 13:40:44   
   
   From: skybuckflying@gmail.com   
      
   Alternative description, perhaps more suited for ChatGPT:   
      
   There are two binary trees of different sizes, different node counts.    
   Try and ask ChatGPT to write an algorithm or routine to convert a Node Number   
   from Tree A to Tree B such that the converted node number will end up on the   
   same node inside Tree B assuming that Tree B grew and added some nodes after   
   Tree A, so Tree A has    
   an older version of the same tree.   
   The ammount of nodes in the tree always grows from 0 to N-1, and then N+1,   
   N+2, N+3, N+4.   
   So basically a growing linked list of nodes must be converted into a binary   
   tree, the objective is to address the nodes of the tree as consistently as   
   possible as the tree grows, or translate the node numbers from old tree to new   
   tree as the tree grows.   
      
   Bye for now,   
     Skybuck.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca