>
means greater than, equal in all languages and math (although it is usually a statement and in programming it is a question that will generate a Boolean result, in which case you are asking if the value of left
is greater than the value of right
.
The result will decide what to do with the next operator that is ternary (currently the only one so), ie it has three parts. His name is conditional operator . Then the value of the second part (after ?
will be the result of every expression if the previous condition is true. If false the result will be the last part, that is, after :
. saved in larger
.
So it's like a if
, but it's an expression.
This code could be written like this:
int left = height(p->left);
int right= height(p->right);
if (left > right) return 1 + left;
else return 1 + right
I placed GitHub for future reference .