comparing subtrees question..
i nee to write a function which desides if the right subtree has more red nodes then the left sub tree
Code:
#include <stdio.h>
#include <stdlib.h>
#define FALSE 0
#define TRUE 1
#define RED 1
#define BLUE 2
typedef struct {
int key;
int color;
}Data;
typedef struct TreeNode{
struct TreeNode *father;
struct TreeNode *left;
struct TreeNode *right;
Data TreeNode_info;
}TreeNode;
int main()
{
return 0;
}
int isRedRight(TreeNode * root)
{
if (root==NULL)
{
return 0;
}
if ((root->TreeNode_info==RED)&&(root->left==NULL)&&(root->left==NULL))
{
return 1;
}
else
{
if (isRedRight(root->right)>isRedRight(root->left))
{
return 1;
}
}
}
i cant return a number of nodes because in this is a "boolean " function
it return only true 1 or false 0
??