In case (i) the refractive index of the medium 2 is less than the refractive index of medium 1 because the ray of light speeds up.
While in case (ii) the refractive index of the medium 2 is greater than the refractive index of medium 1 due to because here the ray of light slows down.