added a check for a sorted array in Table::Partition()