•Depth[expr]等于用以确定 expr的任意部分所必需的指标的最大值加 1 .
• 原始对象的深度为 1.
The depth of an expression is one more than the level of its most deeply nested atom.
This is the same as the number of levels in the expression as shown by TreeForm.
Instead of counting brackets or levels, we can calculate the depth. We start by replacing all the atoms with the same symbol, say xx.
Now we can easily find the positions of all the atoms in the original expression.
The depth is more than the maximum number of indices needed to specify those positions.
We clear the definition.