import java.awt.*;
import java.awt.event.*;
import Supporting.*;

public class SecondaryCluster extends Cluster
{
    public SecondaryCluster( )
    {
        setTitle( "Quadratic probing " + LOAD_FACTOR  );
    }

    public void fillIt( )
    {
        for( int i = 0; i < (int) ( NUM_SLOTS * LOAD_FACTOR ); i++ )
        {
            int pos;
            int collision = 0;
            for( pos = r.randomInt( 0, NUM_SLOTS - 1 ); slots[ pos ] != 0; collision++ )
            {
                pos += 2 * collision + 1;
                if( pos >= NUM_SLOTS )
                    pos -= NUM_SLOTS;
            }

            slots[ pos ]++;
        }
    }

}
