score:0

Accepted answer

Works for me on scala 2.10.0

import scala.collection.mutable._

then paste in the code you supply above. makeOrderedLeafList compiles without error and seems to work in the intended way:

scala> makeOrderedLeafList(List(('a',8),('b',9),('c',99),('d',1)))
res0: List[Leaf] = List(Leaf(d,1), Leaf(a,8), Leaf(b,9), Leaf(c,99))

Related Query

More Query from same tag