为什么在Scala中没有可变的TreeMap? [英] Why is there no mutable TreeMap in Scala?

查看:430
本文介绍了为什么在Scala中没有可变的TreeMap?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是时间不够,有些技术问题还是有不应该存在的原因?

Is it lack of time, some technical problem or is there a reason why it should not exist?

推荐答案

一个缺失的情况下,可能最终会被填充。没有理由不这样做,在某些情况下,它会比不可变树(因为修改需要log(n)对象创建一个不可变的树,并且只有1用可变树)。

It's just a missing case that will presumably eventually be filled in. There is no reason not to do it, and in certain cases it would be considerably faster than the immutable tree (since modifications require log(n) object creations with an immutable tree and only 1 with a mutable tree).

编辑:实际上它是在2.12填写的。

and in fact it was filled in in 2.12.

Mutable TreeMap

(还有一个相应的 Set 。)

这篇关于为什么在Scala中没有可变的TreeMap?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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