02-14-2018, 11:01 PM

Just to make sure I am understanding the specs correctly, how should the following behave when calling statisticsBST?

16

/ \

15 27

/ / \

12 25 29

/ \ /

9 14 23

/ / / \

1 13 20 24

/

0

should statisticsBST on t result in:

Nodes: 14

Minimum depth: 1

Maximum depth: 5

or:

Nodes: 14

Minimum depth: 2

Maximum depth: 6

Note here that the node that gives minimum depth has value of 15 since it's right child is null, and 0 has the maximum depth since it is the furthest node from the root with a null child. I'm just curious if we're effectively counting the number of edges or the number of vertices we visit.

16

/ \

15 27

/ / \

12 25 29

/ \ /

9 14 23

/ / / \

1 13 20 24

/

0

should statisticsBST on t result in:

Nodes: 14

Minimum depth: 1

Maximum depth: 5

or:

Nodes: 14

Minimum depth: 2

Maximum depth: 6

Note here that the node that gives minimum depth has value of 15 since it's right child is null, and 0 has the maximum depth since it is the furthest node from the root with a null child. I'm just curious if we're effectively counting the number of edges or the number of vertices we visit.