Files
2022-02-25 15:33:16 +02:00

30 lines
508 B
C

#include "General.h"
BinaryTree * GetBrotherBinaryTree(BinaryTree * root, BinaryTree * p)
{
if (root)
{
return (NULL);
}
else
{
if (root->left == p)
{
return (root->right);
}
else if (root->right == p)
{
return (root->left);
}
else
{
return (GetBrotherBinaryTree(root->left, p) ||
GetBrotherBinaryTree(root->right, p));
}
}
}
void main(void)
{
}