L
Lie Ryan
João Valverde said:Propose such alternative then. There are none that offer the same
performance. At best they're workarounds.
I don't care about recipes. That's called research.
If people don't find it to be useful, that's fine. Surprising, but fine.
Python devs, based on my observation, tend to choose a data structure
based on the interface and not its implementation. Binary Sorted Tree is
an implementation, its interface can be a sorted dict (sorted key-value
mapping) or a list (not the most natural interface for a tree).
Basically, python already have all the common interfaces, i.e. list,
set, and mapping/dict.
Let's see it like this. In how many ways can a list be implemented?
- Array (python's builtin list)
- Linked List
- Binary Tree
- and the list goes on...
All of them can expose their interface as list, but only array
implementation is available as builtin.