python cocktail sort

todo: c++ implementation :neckbeard: