What returns the method getChildCount of DelegateTree class? It is a bit unclear for me (after reading API doc) if it's the number of immediate children or the number of all descendants.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"Successor" is not the same thing as "descendant". In mathematical contexts such as this, "successor of X" is something that comes right after X, not something that appears at some point later.
In any case, it's the number of immediate children, which is why it's called "getChildCount".
Joshua
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for the explicit answer.
So I lack the method returning the number of all descendants of given v ( = -1 ). Surely, it may be calculated quite easily (e.g. by BFS), anyway I thought there is some method doing this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What returns the method getChildCount of DelegateTree class? It is a bit unclear for me (after reading API doc) if it's the number of immediate children or the number of all descendants.
Adam:
"Successor" is not the same thing as "descendant". In mathematical contexts such as this, "successor of X" is something that comes right after X, not something that appears at some point later.
In any case, it's the number of immediate children, which is why it's called "getChildCount".
Joshua
Thank you for the explicit answer.
So I lack the method returning the number of all descendants of given v ( = -1 ). Surely, it may be calculated quite easily (e.g. by BFS), anyway I thought there is some method doing this.
If you don't mind some overhead, you can use TreeUtils.getSubtree().getVertexCount() - 1. Or you can write a few lines of code.
Joshua