1

I would like to determine the size of a tree by number of vertices.

Clearly,

len(list(PreOrderIter(root)))

gives me this number.

Is this the way to do it?

In other words, is there a recommended dedicated function or something for this in anytree?

Can the above be possibly more efficient somehow?

Bálint Sass
  • 310
  • 3
  • 11

0 Answers0