Here we have a head-on elastic collision between two laboratory trolleys of equal mass. No energy is lost in this ideal collision. The direction of motion of each trolley is simply reversed. Theoretically speaking, this is equivalent to multiplying each velocity by -1.

Elastic Collision with a Stationary Trolley

Here we have another elastic collision. As is the first example, the trolleys are of equal mass, but this time the first trolley collides with a stationary trolley. Once again, no energy is lost, but in this example all the energy (kinetic) of the first trolley, is given to the second one. The first one is brought to rest by the collision, while the second one moves off with the same velocity that the first one had.
Note: The stationary trolley is repositioned after each collision, to prevent the collision point from regressing towards the left of the picture.

Inelastic Collision

Finally, we have an inelastic collision between two trolleys of equal mass. As in the previous example, the second trolley is initially stationary, but the collision is now totally inelastic, so that the two trolleys 'stick' together, and move off with with only half the velocity of the initial moving trolley. There is an appreciable loss of kinetic energy is this type of collision. The lost kinetic energy is transformed mainly into heat energy, plus a little sound energy.