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  
 
 [ 3 post ] 

 Relevant Pages 

1. Passing arguments to function: Building tree in APL

2. Need to build a tree buttom-up (parse tree)

3. Is anyone aware of APL decision tree software?

4. Fractured Trees in Comp.Lang.APL

5. C4: building a relation tree?

6. Building Tree for list of nodes in level order

7. Build a tree solver...

8. ruby-htmltools, a tree-building HTML parser version 1.01

9. ruby-htmltools, a tree-building HTML parser

10. Building and traversing binary trees

11. Building a Binary Tree in Fortran 77

12. Building Modules outside of Python Source Tree

 

 
Powered by phpBB® Forum Software