简体   繁体   中英

Using sortedcontainers in Python to emulate BST

I see some people recommending using SortedContainers as a drop in for some tree structures like Binary Trees like this reddit thread. The documentation for SortedContainers mentions how it's more space efficient than typical implementations of Binary Trees

Having said that, I don't actually see anyone talk about HOW to use it as such and I'd greatly appreciate if someone had a reference for how to emulate a BST or something of the like using Sortedcontainers or SortedCollection

更新:在我的用例中,我不需要“使用 sortedcontainers 来模拟树结构 X”,因为它是引擎盖下的树结构 X

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