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.

X-Received by 2002:ac8:4086:0:b0:3b7:fda5:2626 with SMTP id p6-20020ac84086000000b003b7fda52626mr334885qtl.1.1676670044847; Fri, 17 Feb 2023 13:40:44 -0800 (PST)
X-Received by 2002:a05:6808:1993:b0:37b:489a:4ee3 with SMTP id bj19-20020a056808199300b0037b489a4ee3mr797016oib.247.1676670044569; Fri, 17 Feb 2023 13:40:44 -0800 (PST)
Path csiph.com!news.swapon.de!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups comp.protocols.tcp-ip
Date Fri, 17 Feb 2023 13:40:44 -0800 (PST)
In-Reply-To <d2ae3636-4e69-487a-ad46-ac5ae7584121n@googlegroups.com>
Injection-Info google-groups.googlegroups.com; posting-host=2001:1c05:2c0f:7400:65f8:fef:58a2:7fec; posting-account=np6u_wkAAADxbE7UBGUIOm-csir6aX02
NNTP-Posting-Host 2001:1c05:2c0f:7400:65f8:fef:58a2:7fec
References <d2ae3636-4e69-487a-ad46-ac5ae7584121n@googlegroups.com>
User-Agent G2/1.0
MIME-Version 1.0
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>
Injection-Date Fri, 17 Feb 2023 21:40:44 +0000
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
X-Received-Bytes 2112
Xref csiph.com comp.protocols.tcp-ip:1122

Show key headers only | 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