The two types of waves are demonstrated by the simulations below. They show that the same system, in this case masses attached to each other by springs, can sustain both a longitudinal and a transverse wave. In the first simulation a short force is applied to compress the system. Make sure that your browser is wide enough to see the whole system.

 

 

 

 

 

 

 

The resulting compression moves to the right and is then reflected by the wall. In the second simulation, the same system is given a short transverse force. The resulting wave also moves to the right and is reflected (upside down) by the wall.