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 _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com