Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Needs these answere ASAP! (TCO 6) In the following binary tree, the height of th

ID: 3588061 • Letter: N

Question

Needs these answere ASAP!

(TCO 6) In the following binary tree, the height of the node with value 6 is _____.

(TCO 6) What binary search tree operation does the method below define? Assume that Node is a class storing the information of a node.

elementType method(Node r)
{
if (r.leftChild()==NULL) return r.info();
else return method(r.leftChild());
}

1. It finds if this is a binary search tree.

2. It finds the root of the binary search tree.

3. It finds the smallest element in the binary search tree.

4. It finds the greatest element in the binary search tree.

15 41 39 24)( 6 12

Explanation / Answer

The height of a node is the number of edges on the longest path from the node to a leaf.

The height of node 6 is 1 . The height of node 12 is 0.

elementType method(Node r)
{
if (r.leftChild()==NULL) return r.info();
else return method(r.leftChild());
}

It finds the smallest element in the binary search tree.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote