Scala 默认设置实现 [英] Scala default Set Implementation

查看:48
本文介绍了Scala 默认设置实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以从 Scala 文档中看到 scala.collection.immutable.Set 只是一个特征.默认情况下使用 Set 实现中的哪一个?HashSet 或 TreeSet(或其他)?

I can see that from Scala documentation scala.collection.immutable.Set is only a trait. Which one on the Set implementation is used by default ? HashSet or TreeSet (or something else) ?

我想了解/规划某些功能的运行时间.

I would like to know/plan the running time of certain functions.

示例:

 scala> val s = Set(1,3,6,2,7,1)
 res0: scala.collection.immutable.Set[Int] = Set(1, 6, 2, 7, 3)

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆