Message224285
Le 29/07/2014 21:15, Raymond Hettinger a écrit :
>
> * One use case for the insert methods is trying to maintain a sort
order (such as an alphabetical order) but we don't have any efficient
search methods such as a binary search to find an insertion point. For
example, if I read an alphabetically sorted config file of key / value
pairs, how would I insert a new key/value pair in the proper position?
You'd certainly prefer a tree for that use case (O(log n) search and
insertion rather than O(n) search and O(1) insertion).
I hadn't thought about the set operations. The use case here is really
linked-list-alike, not set-alike.
I'm mildly relieved that, even though O(n), middle-of-list insertions
are still plenty fast for reasonable sizes, which means Numba shouldn't
suffer here (even though we do seem to have users generating Python code
and then JIT-compiling it...). |
|
Date |
User |
Action |
Args |
2014-07-30 01:42:29 | pitrou | set | recipients:
+ pitrou, loewis, rhettinger, vstinner, ezio.melotti, yaubi, serhiy.storchaka |
2014-07-30 01:42:29 | pitrou | link | issue22097 messages |
2014-07-30 01:42:29 | pitrou | create | |
|