all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
-module(gnome_sort).
|
||||
-export([gnome/1]).
|
||||
|
||||
gnome(L, []) -> L;
|
||||
gnome([Prev|P], [Next|N]) when Next > Prev ->
|
||||
gnome(P, [Next|[Prev|N]]);
|
||||
gnome(P, [Next|N]) ->
|
||||
gnome([Next|P], N).
|
||||
gnome([H|T]) -> gnome([H], T).
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
Eshell V5.7.3 (abort with ^G)
|
||||
1> c(gnome_sort).
|
||||
{ok,gnome_sort}
|
||||
2> gnome_sort:gnome([8,3,9,1,3,2,6]).
|
||||
[1,2,3,3,6,8,9]
|
||||
3>
|
||||
Loading…
Add table
Add a link
Reference in a new issue