简体   繁体   中英

How to store a dictionary of key-value pairs in a balanced binary tree

I Know that c++ has multimap , I am wondering what is called in python? How can I store a dictionary of key-value pairs in a balanced binary tree for the code below?

from random import randrange
mydict = {}
for i in range(100):
   mydict['key'+str(i)] = randrange(10)

I Know that c++ has multimap , I am wondering what is called in python? How can I store a dictionary of key-value pairs in a balanced binary tree for the code below?

from random import randrange
mydict = {}
for i in range(100):
   mydict['key'+str(i)] = randrange(10)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM