To store changed visited values from children of this node i . e . number of nodes visited by its children
int vis = 0 ; Iterator hmIterator = node . children . entrySet ( ) . iterator ( ) ; while ( hmIterator . hasNext ( ) ) { Map . Entry child = ( Map . Entry ) hmIterator . next ( ) ; vis += dfs ( ( TrieNode ) child . getValue ( ) , depth + 1 ) ; }