private void checkCoverTree ( Node cur , int [ ] counts , int depth ) { counts [ 0 ] += 1 ; // Node count counts [ 1 ] += depth ; // Sum of depth counts [ 2 ] = depth > counts [ 2 ] ? depth : counts [ 2 ] ; // Max depth counts [ 3 ] += cur . singletons . size ( ) - 1 ; counts [ 4 ] += cur . singletons . size ( ) - ( cur . children == null ? 0 : 1 ) ; if ( cur . children != null ) { ++ depth ; for ( Node chi : cur . children ) { checkCoverTree ( chi , counts , depth ) ; } assert ( ! cur . children . isEmpty ( ) ) : "Empty childs list." ; } }
Collect some statistics on the tree .