concept depth in category functional programming

appears as: depth, The depth, depth
Functional Programming in Java: How functional techniques improve your Java programs

This is an excerpt from Manning's book Functional Programming in Java: How functional techniques improve your Java programs.

Write a divide(int depth) method that will divide a list into a number of sublists. The list will be divided in two, and each sublist recursively divided in two, with the depth parameter representing the number of recursion steps. This method will be implemented in the List parent class with the following signature:

The depth of an element is the length of the path from the root to the element. The first element, also called the root, has a depth of 0. In the perfectly balanced tree in figure 10.2, 5 and 4 have a depth of 1; and 2, 8, 7, and 3 have a depth of 2.

By convention, the height and depth of an empty tree are equal to -1. You’ll see that this is necessary for some operations, such as balancing.