Recursion (computer science): Difference between revisions

Content deleted Content added
cleaner description of see also
m caps
Line 269:
</syntaxhighlight>
 
Note the use of [[short-circuit evaluation]] of the Boolean &amp;&amp; (AND) operators, so that the recursive call is made only if the node is valid (non-Null). Note that while the first term in the AND is a pointer to a node, the second term is a booleanBoolean, so the overall expression evaluates to a booleanBoolean. This is a common idiom in recursive short-circuiting. This is in addition to the short-circuit evaluation of the Boolean || (OR) operator, to only check the right child if the left child fails. In fact, the entire [[control flow]] of these functions can be replaced with a single Boolean expression in a return statement, but legibility suffers at no benefit to efficiency.
 
===Hybrid algorithm===