We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68473af commit a87e52fCopy full SHA for a87e52f
sorts/gnome_sort.py
@@ -10,6 +10,16 @@
10
11
For manual testing run:
12
python3 gnome_sort.py
13
+Gnome Sort Algorithm implementation in Python.
14
+
15
+Gnome sort (also called Stupid Sort) works by comparing the current element
16
+with the previous one. If they are in the wrong order, it swaps them and
17
+moves one step back. Otherwise it moves one step forward.
18
19
+Time Complexity: O(n^2) in the worst case
20
+Space Complexity: O(1)
21
22
+Reference: https://en.wikipedia.org/wiki/Gnome_sort
23
"""
24
25
0 commit comments