boolean checkDuplicates ( List < List < NodeInfo > > grid ) { for ( int i = 0 ; i < listInfo . size ; i ++ ) { listInfo . get ( i ) . marked = false ; } for ( int i = 0 ; i < grid . size ( ) ; i ++ ) { List < NodeInfo > list = grid . get ( i ) ; for ( int j = 0 ; j < list . size ( ) ; j ++ ) { NodeInfo n = list . get ( j ) ; if ( n . marked ) return true ; n . marked = true ; } } return false ; }
Checks to see if any node is used more than once