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

Hi I want to write a method to calculate the depth of a binarytree by a recursiv

ID: 3609486 • Letter: H

Question

Hi I want to write a method to calculate the depth of a binarytree by a recursive function. Here is the class I used public classIntBTNode
{
   private int data;
   private IntBTNode left,right;   public int getData() public IntBTNodegetLeft( ) public IntBTNodegetRight( ) public intgetLeftmostData( ) public intgetRightmostData( ) public boolean isLeaf() public IntBTNoderemoveLeftmost( ) public IntBTNoderemoveRightmost( ) public void setData(intnewData)   public voidsetLeft(IntBTNode newLeft) public voidsetRight(IntBTNode newRight) } Hi I want to write a method to calculate the depth of a binarytree by a recursive function. Here is the class I used public classIntBTNode
{
   private int data;
   private IntBTNode left,right;   public int getData() public IntBTNodegetLeft( ) public IntBTNodegetRight( ) public IntBTNodegetRight( ) public intgetLeftmostData( ) public intgetRightmostData( ) public boolean isLeaf() public IntBTNoderemoveLeftmost( ) public IntBTNoderemoveRightmost( ) public void setData(intnewData)   public voidsetLeft(IntBTNode newLeft) public voidsetRight(IntBTNode newRight) } }

Explanation / Answer

It looks good, but there's some question mark in the answer.could you clarify that? Thank you!

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