The velocity of a transverse wave in a stretched string is given by
v = √(F/m)
where F is tension in the string and m is mass per unit length of the wire.
The velocity of longitudinal waves in an elastic medium is given by
v = √(E/ρ)
where E is elasticity.
Since the value of elasticity is more in solids, the velocity of longitudinal waves in solids is greater than that in gases and liquids.
vg < vl < vs