(Sorry, my question is long but it is very easy to understand.)
I have a tree structure. Each node in this tree structure may have various number of children nodes. And I have a procedure that traces
all of the nodes in this tree and does some time-consuming computation at each step.
I want to use a TProgressBar or a TGauge to inform the user about the progress of this computing process. In order to do so, I have to know the total number of nodes in the tree but since this tree lies in some database tables on the hard disk, it is meaningless to add an additional cost to calculate the number of nodes before the actual computation.
My question is, is there another way to make use of the progress bar in a way that we won't need to do such a node-counting calculation beforehand?
That is, will adding the number of nodes incrementally during the actual computing process help us?
(Previously I asked a similar question about Progress bars on this board, but now i reduced it to a specific one, and if it is possible, i need sample code or pseudocode)