Phango - questions
Sean Kelly
sean at f4.ca
Tue Nov 20 09:33:44 PST 2007
Matti Niemenmaa wrote:
> Christopher Wright wrote:
>> Also, this hierarchical documentation could be as simple as "if you want
>> to accomplish this task, you should look at this module", and then it's
>> O(1) to get to the file in the flat structure, not O(log n) as with the
>> hierarchical one.
>
> Ah, but consider the task of finding the right part of the module. :-)
>
> For the flat structure, it's O(l) where l is the length of the file.
>
> For the hierarchical structure, it's O(L + d) where L is the length of the right
> file in the hierarchy and d is the depth of the hierarchy.
I just woke up and your math is confusing me :-) I like two things
about hierarchical structures: first, logically grouped things are
typically grouped in a directory, and second, if I have a rough idea
where to look then I get fewer false hits with grep. In large code
bases, this can be a real time-saver.
Sean
More information about the Digitalmars-d
mailing list