You cannot determine the wavelength of a photon of specified frequency unless you also specify the medium through which the photon is traversing. The propagation speed of light varies in different media. In a vacuum, it is "c" = 2.998 * 10^8 m/sec, but in other media, the propagation speed is lower. Tell your teacher he/she writes sloppy questions.
In general, for any wave, the wavelength (λ) and frequency (f) are related by:
f*λ = c
where c is the propagation speed of the wave in the relevant medium.
For light propagating in a vacuum, c = 2.998 * 10^8 m/s, so a photon with frequency of 5.10*10^14/sec would have a wavelength of:
λ = (2.998 * 10^8 m/s)/( 5.10*10^14/sec) = 5.88 *10^(-9) m = 588 nm
This same photon propagating in water, for which the speed of light is 1.33 times less (more or less -- it depends on the frequency) than the propagation speed in a vacuum would be:
λ = ((2.998 * 10^8 m/s)/1.33)/( 5.10*10^14/sec) = 4.42 *10^(-9) m = 442 nm
Clearly, this wavelength is quite different from the case of light propagating in a vacuum. (So you should really rub your teacher's nose in her/his lack of specificity. <g>)
In general, for the frequencies covering the range of visible light, the propagation speed of light through a medium relative to the speed in a vacuum is characterized by the "refractive index" of the medium, "n":
refractive index = n = (speed of light in a vacuum)/(speed of light in the medium).
For nearly all media (but not the vacuum), the speed of light varies as a function of frequency, so the refractive index is also a function of the frequency of the light. This variation of speed with frequency (or, equivalently, energy) is called "dispersion".