[Python-3000] How will unicode get used?
"Martin v. Löwis"
martin at v.loewis.de
Thu Sep 28 05:21:52 CEST 2006
Josiah Carlson schrieb:
> Attached is my untested sample implementation (I'm away for the next
> week or so, and can't test), that should give an idea of what I was
> talking about.
Thanks. It is hard to tell what the impact on the implementation is.
For example, ISTM that you have to regenerate the tree each time
a new string is created. E.g. if you slice a string, you would
have to regenerate the tree for the slice. Right?
As for the implementation: If you are using a array-based heap,
couldn't you just drop the left and right child pointers, and
instead use indices 2*k and 2*k+1 to find the child nodes?
This would get down memory overhead significantly; you'd only
need the length of the array to determine what a leaf node is.
Regards,
Martin
More information about the Python-3000
mailing list