Sets the depth of vertex to level and then recursively sets the depth of all of the children of vertex to (1+ level).
vertex