Weitere Beispiele werden automatisch zu den Stichwörtern zugeordnet - wir garantieren ihre Korrektheit nicht.
The simplest form of cocktail sort goes through the whole list each time:
Dressed up in silk stockings and, say, a cocktail sort of dress, she might be very glamorous.
However one cocktail sort pass should be counted as two bubble sort passes.
Typically cocktail sort is less than two times faster than bubble sort.
Cocktail sort is a slight variation of bubble sort.
Note, however, that cocktail sort more often refers to a bidirectional variant of bubble sort.
Cocktail sort is a bi-directional bubble sort that goes from beginning to end, and then reverses itself, going end to beginning.
A bidirectional variant of selection sort, called cocktail sort, is an algorithm which finds both the minimum and maximum values in the list in every pass.
As the Cocktail sort goes bidirectionally, the range of possible swaps, which is the range to be tested, will reduce per pass, thus reducing the overall running time.
Cocktail sort is also briefly discussed in the book The Art of Computer Programming, along with similar refinements of bubble sort.
Sharp, rather salty pecorino romano, a sheep's milk cheese, is a favorite accompaniment for what is meant to be a cocktail sort of food, something to nibble on while you sip white wine and consider the menu.
An example of a list that proves this point is the list (2,3,4,5,1), which would only need to go through one pass of cocktail sort to become sorted, but if using an ascending bubble sort would take four passes.