Re: tree model complaints



On Sun, Aug 15, 2004 at 03:16:26PM +0100, Tim Müller wrote:
On Sunday 15 August 2004 11:37, D M wrote:

    I'm implementing a custom tree model in my application. And one
thing itrigues me a little - why does it involve implementing
a functions which are complementary - getting n'th child is kind
of equivalent of getting first child and then iterating
over consecutive elements. 

Just because the result is the same doesn't mean that those are equivalent 
actions. Imagine a model that can access row data in a way where accessing 
the 9999th row takes more or less the same time as accessing the 1st row. In 
this case it would be madness to iterate through all previous 9998 rows just 
to retrieve the 9999th row's data. In other words: it depends on the 
underlying data structures whether those two methods of accessing the n-th 
row are more or less equivalent or not.

Yes, thats true, but my point is :no matter how underlaying data 
are structred I have to provide both methods ( or even three 
- path to iterator conversion)

-- 
DM



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]