摘要: //提供的int排序的统一方法 val intSort = msort((x:Int,y:Int)=>x<y) _ //逆序 val reverseIntSort = msort((x:Int,y:Int)=>x>y) _ 阅读全文
posted @ 2018-09-02 15:37 uuhh 阅读(145) 评论(0) 推荐(0)
摘要: //插入排序 def isort(xs:List[Int]):List[Int]= if(xs.isEmpty)Nil else insert(xs.head,isort(xs.tail)) def insert(x:Int,xs:List[Int]):List[Int]= if(xs.isEmpty || xList() case x::xsl=>insert... 阅读全文
posted @ 2018-09-02 13:30 uuhh 阅读(263) 评论(0) 推荐(0)