cocktail sort with pointers and two structures for