/*
 *  gnome sort
 *  ----------
 *  author: ghostsnstuff
 *  date: March 27, 2014
 *  src: http://en.wikipedia.org/wiki/Gnome_sort
 *  complexity:
 *   - worst case O(n^2)
 *   - best case O(n)
 *   - avg case O(n^2) 
 */
class GnomeSort {
	static int[] GnomeSort(int[] list) {
		int pos = 1;
		while(pos < list.length) {
			if(list[pos] >= list[pos-1]) {
				pos++;
			} else {
				int temp = list[pos];
				list[pos] = list[pos-1];
				list[pos-1] = temp;
				if(pos > 1) {
					pos--;
				}
			}
		}
		return list;
	}		
	static void log(int[] list) {
		for(int i = 0; i < list.length; i++) {
			System.out.print(list[i]+" ");
		}
	}
}
@@ -234,17 +234,18 @@
 eSort %7B%0A
-%09
+  
 static i
@@ -273,18 +273,20 @@
 list) %7B%0A
-%09%09
+    
 int pos 
@@ -290,18 +290,20 @@
 os = 1;%0A
-%09%09
+    
 while(po
@@ -321,19 +321,22 @@
 ngth) %7B%0A
-%09%09%09
+      
 if(list%5B
@@ -362,22 +362,29 @@
 ) %7B%0A
-%09%09%09%09
+        
 pos++;%0A
-%09%09%09
+      
 %7D el
@@ -388,19 +388,16 @@
  else %7B%0A
-%09%09%09
 %09int tem
@@ -411,19 +411,16 @@
 t%5Bpos%5D;%0A
-%09%09%09
 %09list%5Bpo
@@ -437,19 +437,16 @@
 pos-1%5D;%0A
-%09%09%09
 %09list%5Bpo
@@ -458,19 +458,16 @@
 = temp;%0A
-%09%09%09
 %09if(pos 
@@ -478,20 +478,18 @@
  %7B%0A%09
-%09%09%09%09
+  
 pos--;%0A%09
 %09%09%09%7D
@@ -488,24 +488,28 @@
 -;%0A%09
-%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09
+%7D%0A      %7D%0A    %7D%0A    
 retu
@@ -521,14 +521,16 @@
 st;%0A
-%09
+  
 %7D%09%09%0A
-%09
+  
 stat
@@ -555,18 +555,20 @@
 list) %7B%0A
-%09%09
+    
 for(int 
@@ -602,11 +602,14 @@
 ) %7B%0A
-%09%09%09
+      
 Syst
@@ -639,12 +639,16 @@
 %22);%0A
-%09%09%7D%0A%09
+    %7D%0A  
 %7D%0A%7D
+%0A

Update GnomeSort.java