public void init ( List < T > list , int bucketSize ) { if ( list . size ( ) < bucketSize ) { throw new RuntimeException ( "There needs to be more than or equal to elements in the 'list' that there are in the bucket" ) ; } this . k = bucketSize ; this . c = bucketSize - 1 ; N = list . size ( ) ; bins = new int [ bucketSize ] ; for ( int i = 0 ; i < bins . length ; i ++ ) { bins [ i ] = i ; } this . a = list ; state = 1 ; }
Initialize with a new list and bucket size