@yahoogroups.com
Subject: Re: [flexcoders] Re: Total Number of Items in a Tree
Make a recursive count function, maybe.
// pseudocode for tree based on an arraycollection
function countNodes( ac:ArrayCollection ): int
{
var count:int = 0;
for(var i:int=0; i < ac.length
Make a recursive count function, maybe.
// pseudocode for tree based on an arraycollection
function countNodes( ac:ArrayCollection ): int
{
var count:int = 0;
for(var i:int=0; i < ac.length; i++) {
count++;
if(ac[i].hasOwnProperty('children')) {
count += this.count
--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Depends on what number you're looking for. The total number of possible
> nodes or the total number based on what nodes are open
I'm looking for the total number of nodes (branches and leaves), no
matter whether they a
3 matches
Mail list logo