Re: double linked list
Date: 11 Feb 2003 21:01:28 -0800
Message-ID: <c0d87ec0.0302112101.364ca09d_at_posting.google.com>
>> First, there are missing links in your data ... <<
ARRGGH! Let me try again:
CREATE TABLE Parent_Down_Tree
(parent_id CHAR (8), -- null means child is the root
child_id CHAR(8) NOT NULL);
parent child
NULL 'Albert''Chuck 'Eddie'
'Albert' 'Bert'
'Bert' 'Chuck'
'Albert' 'Chuck'
'Chuck' 'Donna'
'Chuck' 'Fred'
CREATE TABLE Child_Up_Tree
(parent_id CHAR (8) NOT NULL,
child_id CHAR(8)); -- null means child is a leaf
parent child
'Albert' 'Chuck'
'Albert' 'Bert'
'Bert' NULL'
'Donna' NULL
'Eddie' NULL
'Fred' NULL
'Chuck' 'Donna'
'Chuck 'Eddie'
'Chuck' 'Fred'
>> for arbitrary graphs ... <<
I am only concerned with trees in these models. The adjacency list (or perhaps an adjacency array) would be the way to do an arbitrary graph. I would say that it is too easy to accidently do an arbitrary graph in the adjacency list model and that people forget to put all of the constraints they need to assure that they have a tree.
>> There is only one adjacency model simply because there is only one adjacency matrix definition in graph theory. The fact that we can consider transposed adjacency matrix too is not important. <<
Only if you are a programmer <g> Received on Wed Feb 12 2003 - 06:01:28 CET