Groups | Search | Server Info | Login | Register


Groups > comp.protocols.tcp-ip > #1122

Re: Translate BinaryTree Node Number to other BinaryTree Node Number of different tree size.

Newsgroups comp.protocols.tcp-ip
Date 2023-02-17 13:40 -0800
References <d2ae3636-4e69-487a-ad46-ac5ae7584121n@googlegroups.com>
Message-ID <2c945ae9-57c7-4fdb-b25c-4359930dfe03n@googlegroups.com> (permalink)
Subject Re: Translate BinaryTree Node Number to other BinaryTree Node Number of different tree size.
From Skybuck Flying <skybuckflying@gmail.com>

Show all headers | View raw


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.

Back to comp.protocols.tcp-ip | Previous | Next | Find similar


Thread

Re: Translate BinaryTree Node Number to other BinaryTree Node Number of different tree size. Skybuck Flying <skybuckflying@gmail.com> - 2023-02-17 13:40 -0800

csiph-web