Key-ordered dict in Python

前端 未结 10 2208
北恋
北恋 2020-11-28 05:14

I am looking for a solid implementation of an ordered associative array, that is, an ordered dictionary. I want the ordering in terms of keys, not of insertion order.

10条回答
  •  情歌与酒
    2020-11-28 05:39

    An ordered tree is usually better for this cases, but random access is going to be log(n). You should keep into account also insertion and removal costs...

提交回复
热议问题