Gnome sort, also known as stupid sort, is a variation of insertion sort that does not use nested loops, building a sorted list one element at a time by moving each item to its correct position through a series of swaps. It was known for a long time and used without a formal name before being popularized by the Iranian computer scientist Hamid Sarbazi-Azad in 2000 and later described and named gnome sort by Dick Grune. Gnome sort performs at least as many comparisons as insertion sort and shares its asymptotic running time characteristics, with an average running time of O(n squared) that tends toward O(n) when the list is already nearly sorted.
Facts
Time Complexity
Time Complexity (category)Quadratic Time -- O(n^2) 1 Connections
In Field
Source Gnome Sort (Wikipedia)
Sources
1. Gnome Sort (Wikipedia)
Wikipedia infobox: time complexity quadratic
quadratic
In Field: Algorithms and Complexity Theory, Lead sentence
Gnome sort (nicknamed stupid sort) is a variation of the insertion sort sorting algorithm that does not use nested loops.
View the SourceNIST Dictionary of Algorithms and Data Structures: gnome sort
NIST Dictionary of Algorithms and Data StructuresIn Group: Comparison Sorting Algorithms, DefinitionQuote, In Group: Comparison Sorting Algorithms, Definition
Put items in order by comparing the current item with the previous item.
View the Source Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.
Sign in to dispute this or suggest a correction.