3 ms·
Sounds like python is not batteries included compared to other languages in this regard!
by nicoburns 6y ago
Sounds like python is not batteries included compared to other languages in this regard!
- NavinF 6y agoDo any languages give you min/max at the same time with their standard library data structures? (setting the key function with "key=lambda x: -x" is really easy and works just like changing a comparator function in other languages so I dunno why you guys are talking about it)
- ghj 6y agoYes actually. Both c++ and java have red black trees. In c++ it's std::set, in java it's TreeSet. BST supports log(n) min/max/inserts/removes (among other stuff).