Building a tree using APL...
Author Message
Building a tree using APL...

Hi:
Can someone let me know or point to a source of, how to make trees
(such as binary tree) using APL.
thanks.
trip

Sat, 06 Jan 1996 02:00:52 GMT
Building a tree using APL...
Quote:

>Hi:
> Can someone let me know or point to a source of, how to make trees
>(such as binary tree) using APL.
>thanks.
>trip

>.

One road is nested arrays:  For example

TREE:                .______ M ______.
|               |
.__ G __.       .__ T _______.
|       |       |       |    |
A       K       P       X    Y

NESTED ARRAY .-----------------------------------------.
|.--------------.     .------------------.|
|| .---.   .---.|     |.---.   .---..---.||
|| | A | G | K ||  M  || P | T | X || Y |||
|| '---'   '---'|     |'---'   '---''---'||
|'--------------'     '------------------'|
'-----------------------------------------'

Bill Knight / University of New Brunswick / Canada

Sat, 06 Jan 1996 22:12:28 GMT
Building a tree using APL...
: Hi:
:       Can someone let me know or point to a source of, how to make trees
: (such as binary tree) using APL.
: thanks.
: trip

In the book "A Programming Language," Kenneth Iverson has trees as part
of the 'language'.  The book lists (uses?):

scalar   a,b,c ...  (italics)
vector   a,b,c ...  (bold italics)
matrix   A,B,C ...  (BOLD ITALICS)
tree     A,B,C ...  (BOLD)

A full right(left) list matrix is defined as:

M <- ]T   or   M <- [T

and is a null filled, common dimensioned right(left) justified matrix in
increasing order.  Trees are compressable ( A/T  or B//T ) and can have
operations performed upon them ( operator jot T ), just like s's, v's and
M's.  The tree should be a mult-dimensional M, containing such information
as number of nodes, number of levels, number of branches per node and a
MARKOV sort of representation of the branching process (ie:

0 1 1 0 0 0 0                         1
0 0 0 1 1 0 0                         |
0 0 0 0 0 1 1           +-------------+-------------+
0 0 0 0 0 0 0           |                           |
0 0 0 0 0 0 0           2                           3
0 0 0 0 0 0 0           |                           |
0 0 0 0 0 0 0    +------+-------+        +----------+---------+
|              |        |                    |
4              5        6                    7

I would be interested in seeing this concept implimented... but I seem
to be lacking round TUIT's these days ... sigh ...

W. LeRoy Davis

Sun, 07 Jan 1996 09:09:21 GMT

 Page 1 of 1 [ 3 post ]

Relevant Pages