A linear-time algorithm for the k-fixed