Data structure for unrooted trees
- by Esmond
I'm having problems figuring out how to build an unrooted tree with weighted edges and what data structure to store such a tree.
An example of an unrooted tree would be like the one here: http://www.bio.davidson.edu/courses/GENOMICS/seq/unrooted.gif
The problem i am having is the leaves would only have 1 link to the internal nodes and the internal nodes would have 3 links(the internal nodes would have 2 children and a link to another internal node). Do i have to distinguish between the 2 different kinds of nodes or can i have one class having the function of both types of nodes?