Home > Back-end >  Statistics of the binary tree leaf nodes equal number and judge whether the two trees
Statistics of the binary tree leaf nodes equal number and judge whether the two trees

Time:09-19

Bosses see give a reference to learn algorithm, c

CodePudding user response:

Can be used in the sequence traversal thoughts, using a recursive implementation,

CodePudding user response:

 void InOrderTraverse (BiTree T)//in the output sequence traversal results 
{if (T)
{InOrderTraverse (T - & gt; Lchild);
Printf (" % c ", T - & gt; The data);
InOrderTraverse (T - & gt; Rchild);
}
}

This is in the sequence traversal algorithm, one by one count/can
  • Related