public void Flip(int x)
{
ushort hb = Utility.GetHighBits(x);
int i = containers.GetIndex(hb);
if (i >= 0)
{
Container c = containers.GetContainerAtIndex(i).Flip(Utility.GetLowBits(x));
if (c.GetCardinality() > 0)
{
containers.SetContainerAtIndex(i, c);
}
else
{
containers.RemoveAtIndex(i);
}
}
else
{
ArrayContainer newac = new ArrayContainer();
containers.InsertNewKeyValueAt(-i - 1, hb, newac.Add(Utility.GetLowBits(x)));
}
}