e70152e44cc66cc599ff6b699eb8adc07f3e656a kent Sat May 24 21:09:34 2014 -0700 Adding Copyright NNNN Regents of the University of California to all files I believe with reasonable certainty were developed under UCSC employ or as part of Genome Browser copyright assignment. diff --git src/lib/elmTree.c src/lib/elmTree.c index 041060a..122c25c 100644 --- src/lib/elmTree.c +++ src/lib/elmTree.c @@ -1,15 +1,18 @@ +/* Copyright (C) 2013 The Regents of the University of California + * See README in this or parent directory for licensing information. */ + // elmTree.c/.h - Extensible local memory tree grown from an slList of objects, via // NEIGHBOR JOINING and a supplied compare routine. Unlike hacTree, this is not a binary tree // and any node can have original content, a single parent and N children. Superficially similar // to running slSort(), running elmTreeGrow() creates a tree from a single "root". All branches // and leaves are represented as "tree nodes" which contain pointers to a user defined object, // a single parent, a first child (if the node is not a leaf) and a next sibling. All nodes are // additionally joined together as an slList with the single "root" as the first member. Thus // the tree can be traversed linerarly through node->next or hierarchically through recursive // node->firstChild,child->sibling access. // The tree is grown through neighbor joins and involves figuring out whether each successive // content should be attached as a branch node or leaf node to the existing tree. To facilitate // neighbor joining, each node has cumulative content from the single root node (whcih has NULL // content). An example might be a tree of bitmaps where each node contains all the bits of its // parent plus additional bits. // Since an elmTree is build with local memory, free the tree by lmCleanup().