Answer
$(a)$ Red has the least energy
$(b)$ Violet has the greatest energy
Work Step by Step
As we know
$E=hv$
Where $E$ is energy , $h$ is Planck's constant and $v$ is the frequency .
As $h$ is constant then energy is directly proportional to frequency.
As we know red has the minimum frequency and violet has the maximum frequency.
Hence red light has the least energy and violet light has the greatest energy.