Longitudinal wave: A wave in which the particles of the medium vibrate back and forth in the ‘same direction’, in which the wave is moving, is called a longitudinal wave.
These waves can be produced in all the three media: solids, liquids and gases.
Transverse wave: A wave in which the particles of the medium vibrate up and down, ‘at right angles’ to the direction in which the wave is moving, is called a transverse wave.
It can be produced in solids and liquids but not in gases.