[thelist] Nested Queries (long example code)
Steve Lewis
slewis at macrovista.net
Wed Aug 21 18:10:28 CDT 2002
Joshua Olson wrote:
> P.S. I know this is not efficient by any means, but the underlying logic is
> digestible by the average programmer, whereas the really neat solutions
> require a lot more thinking. :-) I think I may make this into a article.
I am curious where you will to go with this. Given the data structure
you started with I have a strong repulsive reflex and am curious what
you can do to improve efficiency with this algorithm (shuffling thru two
stacks) with some time and thought.
If you are solving a more complex problem of traversing a network/graph
(where groups are many-to-many), rather than a tree (where groups are
one-to-many) you need to find a way to avoid getting caught in loops...
object Table data
1 1 Group1 prop1 prop2 prop3 ... propx
2 2 Group2 prop1 prop2 prop3 ... propx
3 3 Group3 prop1 prop2 prop3 ... propx
4 4 Group4 prop1 prop2 prop3 ... propx
membership Table data
1 3
2 1
3 2
4 2
--Steve
More information about the thelist
mailing list