Ben,<br><br>Perhaps try communicating the problem you're trying to solve with the data structure. ie, what you're storing, what would you be looking for when searching stored objects...<br><br>This would yield better advice, and share information within the context of sugar.<br>
<br><br>James.<br><br><br><div class="gmail_quote">2009/6/8 Benjamin M. Schwartz <span dir="ltr"><<a href="mailto:bmschwar@fas.harvard.edu">bmschwar@fas.harvard.edu</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've had amazing difficulty communicating what I'm looking for here.<br>
<br>
Those closest thing is<br>
<br>
<a href="http://en.wikipedia.org/wiki/Rope_%28computer_science%29" target="_blank">http://en.wikipedia.org/wiki/Rope_(computer_science)</a><br>
<br>
A rope is a binary tree that _imposes_ an ordering on its leaves that has<br>
nothing whatsoever to do with their values (the values are essentially<br>
opaque). This is very unusual; almost all standard tree structures<br>
_derive_ an ordering _from_ the values.<br>
<br>
Unfortunately, all implementations of Ropes that I have seen so far are<br>
designed only to store Chars, whereas I need to store arbitrary python<br>
objects. I'd like to avoid coding such a beast myself, but I may have no<br>
choice. It would help if someone could identify Ropes as a specialization<br>
of a more general type of tree, but I have not seen any claims of this kind.<br>
<br>
The only property I'm looking for that Ropes don't intrinsically satisfy<br>
is "Reverse lookup". That is to say, I would like to be able to hold a<br>
pointer to a particular object in the tree, and at some later time, walk<br>
back up the tree from that pointer to work out the object's current index.<br>
It does seem like that should be doable with a Rope, especially if we<br>
move to the special case in which the leaves are "arrays of length 1".<br>
<br>
--Ben<br>
<br>
<br>_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br></blockquote></div><br>