Question: For this assignment I would like you to complete the following methods in the Tree _ Algorithms.py file above - numberOfLeaves - This method should
For this assignment I would like you to complete the following methods in the TreeAlgorithms.py file above
numberOfLeaves
This method should count and return the number of leaves listed in the provided tree
numberOfNodesWithASingleChild
This method should count and return the number of tree nodes that only have a single child in the provided tree
numberOfNodesWithTwoChildren
This method should count and return the number of tree nodes that have two children in the provided tree
numberOfNodesWithEvenDataltems
This method should count and return the number of tree nodes that have even values in the provided tree
sumOfAllltems
This method should count and return all the values in the provided tree
printRuntimes
You should add the BigOh times for the algorithms you created into this method
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
