🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #62452

Ode to the xBin (xMas?) trees

#62452
From: Rene
Date: Thu, 26 Dec 2002 15:23
32 lines
2147 bytes
Been thinking about the hashTree structure again.

And again (*sigh*) I think I've found the solution to the right-subtree of
skewed trees.

But before I'm going to post some real or pseudo code again, that won't
work correctly, I'm going to write a small test-programm and I will test my
formula toroughly.

I basically found a method, to map non-powerOfTwo(po2) trees on po2 trees.
And po2-trees are easy to calculate:

For any po2 tree with N (1..N) nodes, a sequence (a,b) (inclusive) has to
include exactly bitcount(a - 1) + bitcount(N - b) hashes. (Number of 1's in
the value of nodes to the left of the sequence plus number of 1's in the
value of nodes to the right of the sequence)

Now this doesn't work for non po2 trees, but I've found an easy mapping.
I'll test it and will post the code/algorithm if it turns out correct.

As a sideeffect, I now have found the worst case of hashes to
transport. worst case is = sequence contains only rightmost hash of the
*left* subtree IF the right subtree has only one hash/node, else the
sequence spanning the rightmost node of the left subtree and the leftmost
node of the right subtree (ie nodes in the middle).

Ok so much for now. Rest should follow as soon as I'm certain it holds

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB
Technical Details
Message-ID: <20021226102324.117$5X@newsreader.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <20021226102324.117$5X@newsreader.com>
Subject: Ode to the xBin (xMas?) trees
Date: Thu, 26 Dec 2002 15:23:24 +0000
From: Rene <invalid@email.addr>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com Subscriber
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com hYhRAC3xTQ@yyiAR8kxC3TKml3qRe@GhQh/cGGxEK.i=9nIn,
Lines: 31