Re: yet another hierarchy model

From: KWillets <kwillets_at_looksmart.net>
Date: 16 Oct 2001 14:54:57 -0700
Message-ID: <eef24980.0110161354.7eb13a84_at_posting.google.com>


Vadim Tropashko <nospam_at_newsranger.com> wrote in message news:<Urmx7.24985$ev2.33971_at_www.newsranger.com>...
> Here is one more way to represent hierarchy: just store depth-first sequence
> number and level (simple, indeed!).
>
(...until one needs to delete or insert a node.)

How about:

  1. Assigning unique prime numbers to all leaf nodes, and assigning each intermediate node the product of its subordinates.
  2. Using a bitmap with each bit assigned to a leaf node, and or'ing the things together at intermediate nodes.
  3. Embedding the tree on a binary tree and keying each node by the bitstring which indicates its position in the B-tree, eg
   A      --->       A
 / | \              / \
B  C  D            B  ()      () is omitted 
                     / \
                    C  D
                 
node    key
A        0
B        00
C        010
D        011

(Omitting the 01 node means that 01* nodes are children of 01's parent, etc.)

This kind of thing can go on and on.... Received on Tue Oct 16 2001 - 23:54:57 CEST

Original text of this message