private static void Swap(IList list, int x, int y) { object tmp; tmp = list[x]; list[x] = list[y]; list[y] = tmp; }