Skip to content

Glossary: Coding Interviews in Java

Tree recursion

Also written: TreeNode

Solving a tree question by returning a base answer for an empty tree (`null`), asking each child for its answer, and combining them with the node's value. It costs O(n).

Where the book teaches it

Related terms

Base casePattern