FACTOID # 104: In Ethiopia, nine out of ten births occur without skilled health staff present.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Cocktail sort

Cocktail sort, also known as bidirectional bubble sort, cocktail shaker sort, shaker sort, ripple sort, shuttle sort or happy hour sort, is a stable sorting algorithm that varies from bubble sort in that instead of repeatedly passing through the list from top to bottom, it passes alternately from top to bottom and then from bottom to top. It can achieve slightly better performance than a standard bubble sort. It is a comparison sort. In computer science and mathematics, a sorting algorithm is an algorithm that puts elements of a list in a certain order. ... In computer science and mathematics, a sorting algorithm is an algorithm that puts elements of a list in a certain order. ... Bubble sort, also known as exchange sort, is a simple sorting algorithm. ... A comparison sort is a particular type of sorting algorithm; a number of well-known algorithms are comparison sorts. ...


Note that 'shaker sort' can also refer to a variant of selection sort. Selection sort is a sort algorithm that works as follows: find the minimum value in the list swap it with the value in the first position sort the remainder of the list (excluding the first value) It is probably the most intuitive sort algorithm to invent. ...


The complexity of cocktail sort in Big O notation is O(n²) for a worst case, but becomes closer to O(n) if the list is mostly ordered at the beginning. Big O notation is a mathematical notation used to describe the asymptotic behavior of functions. ...


Implementation

For implementations in real programming languages, see Cocktail sort at Wikisource.



 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m