ible
professional vim user
everything here is pretty amusing:
http://www.dangermouse.net/esoteric/
one of my favorites: dropsort is a revolutionary O(n) sorting algorithm that iterates through an array, simply dropping elements which are not sorted:
http://www.dangermouse.net/esoteric/dropsort.html
as a way to make it actually do "non-lossy" sorting, you can keep track of dropped items and recursively dropsort them, then merge with the original (undropped) list. here's a python code, for sh*ts and g*ggles.
where the merge function is left to the reader
http://www.dangermouse.net/esoteric/
one of my favorites: dropsort is a revolutionary O(n) sorting algorithm that iterates through an array, simply dropping elements which are not sorted:
http://www.dangermouse.net/esoteric/dropsort.html
as a way to make it actually do "non-lossy" sorting, you can keep track of dropped items and recursively dropsort them, then merge with the original (undropped) list. here's a python code, for sh*ts and g*ggles.
Code:
def dropsort(A):
len_A = len(A)
if len_A == 0:
return []
A_sorted = [A[0]]
A_dropped = []
for i in range(1, len_A):
if A[i] >= A_sorted[-1]:
A_sorted.append(A[i])
else:
A_dropped.append(A[i])
A_dropped = dropsort(A_dropped)
return merge(A_sorted, A_dropped)
where the merge function is left to the reader
Last edited: