diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-13 10:07:09 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-13 10:07:09 -0800 |
commit | 1e530365fd3a1ab749091e7c56850405dc98aed1 (patch) | |
tree | e98e6e16c5f6fd003ef4c6581fa8a97f215ccfed /docs/examples/sort2.scala | |
parent | d614965f083981817bfa08b84a07c069987d0a78 (diff) | |
parent | 3bfd83971ec48102fd1e711236f5a313c6a1ce3e (diff) | |
download | scala-1e530365fd3a1ab749091e7c56850405dc98aed1.tar.gz scala-1e530365fd3a1ab749091e7c56850405dc98aed1.tar.bz2 scala-1e530365fd3a1ab749091e7c56850405dc98aed1.zip |
Merge pull request #3265 from retronym/merge/2.10.x-to-master
Merge 2.10.x to master
Diffstat (limited to 'docs/examples/sort2.scala')
-rw-r--r-- | docs/examples/sort2.scala | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/docs/examples/sort2.scala b/docs/examples/sort2.scala deleted file mode 100644 index e0016088bb..0000000000 --- a/docs/examples/sort2.scala +++ /dev/null @@ -1,25 +0,0 @@ -package examples - -object sort2 { - - def sort(a: List[Int]): List[Int] = { - if (a.length < 2) - a - else { - val pivot = a(a.length / 2) - def lePivot(x: Int) = x < pivot - def gtPivot(x: Int) = x > pivot - def eqPivot(x: Int) = x == pivot - sort(a filter lePivot) ::: - (a filter eqPivot) ::: - sort(a filter gtPivot) - } - } - - def main(args: Array[String]) { - val xs = List(6, 2, 8, 5, 1, 8) - println(xs) - println(sort(xs)) - } - -} |