Initialize all entries of lookup table as not filled memset ( lookup , - 1 , sizeof ( lookup ) ) ;
for ( int k = 0 ; k < lookup . GetLength ( 0 ) ; k ++ ) { for ( int j = 0 ; j < lookup . GetLength ( 1 ) ; j ++ ) { lookup [ k , j ] = - 1 ; } }