Skip to content

q08BinaryTreeDepthStats

solutions.q08BinaryTreeDepthStats

Question 8

Given a binary tree, \(B\) find its min, max and average depths.

PS: Depth of a tree is defined by the distance of leaf nodes from the root, not that of any intermediary nodes.

Functions:

Name Description
q08BinaryTreeDepthStats

Args:

q08BinaryTreeDepthStats(B, s)

Parameters:

Name Type Description Default
B Graph

Graph resolves into G.V and G.E.

required
s int

The root node.

required