12-Strahler Numbers and Pruning Numbers

12-Strahler Numbers and Pruning Numbers - assign to a...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Strahler Numbers and Pruning Numbers Binary Trees - Strahler Numbers Each node of a binary tree is assigned a Strahler as follows: All leaf nodes are assigned 1. If a node has only one successor, it is assigned the number of its successor otherwise it is assigned the larger of the numbers assigned to its successors if they have different numbers; if they have the same number it is assigned that number plus 1. The Strahler number assigned to the root is the Strahler number of the binary tree. Give some examples! Ordered Forests - Prunning Numbers A filament of a tree is a chain of nodes all of which have only one child except for the last node which is a leaf node and whose first node has at least one sibling or is the root. Give some examples! Pruning a forest means removing all the filaments. The pruning number of a forest is the number of times the forest has to be pruned before the forest is empty. An alternate algorithm for pruning number of a forest: Determine the pruning # of a tree by assigning 1 to each node with no subtrees and then
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: assign to a parent the maximum pruning number assigned to its children if only one child has such a maximum, and the maximum plus 1 if more than one child has the maximum. The pruning # of a forest is then the maximum of the pruning numbers of its trees. Give some examples! Assignment 6. Use the program from Assignment 5 (that generates all n node binary trees) to determine the number of n node binary trees with each possible Strahler number and also to determine the number of n node forests with each possible pruning number. These pruning numbers must be determined using the alternate algorithm. In this way, create a table that, for each n from 2 to as close to 20 as you can get (but at least 15), lists the number of n node binary trees with each possible Strahler number and the number of n node forests with each possible pruning number. What do you notice about the two tables?...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern