Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
|
|
@ -1,2 +1,2 @@
|
|||
def isSorted(l: List[Int]) = l.iterator sliding 2 forall (s => s.head < s.last)
|
||||
def isSorted(l: List[Int]) = l.iterator sliding 2 forall (s => s.head <= s.last)
|
||||
def bogosort(l: List[Int]): List[Int] = if (isSorted(l)) l else bogosort(scala.util.Random.shuffle(l))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue