Class assignment for on-line algorithms