-
kimukou2628
- 1495
- 0
- 1
- 2
![](https://s.togetter.com/static/web/img/placeholder.gif)
確かにScalaのsortはjava.util.Arrays.sortを呼び出してる。mutableなsortの方が早そうだし調べてみっか #fantech [Moon]
2012-10-09 20:25:56![](https://s.togetter.com/static/web/img/placeholder.gif)
別解に挑戦。 args.toList.sortWith(_.compareTo(_) < 0).foreach(println) コンパレータ渡し版。 #fantech
2012-10-09 20:29:09![](https://s.togetter.com/static/web/img/placeholder.gif)
import scala.util.Sorting import scala.util.Sorting は反則? #fantech
2012-10-09 20:32:22![](https://s.togetter.com/static/web/img/placeholder.gif)
想定していた模範解答。 object Main { def main(args : Array[String]) : Unit = { args.toList.sorted.foreach(println) } } #fantech
2012-10-09 20:37:53![](https://s.togetter.com/static/web/img/placeholder.gif)
Scaladoc の Array にも List にも toList がないとか、文字列ソートだと昇順で2より10が前になるとかあんまり考えてなかった。。#fantech
2012-10-09 20:39:37