|
-
Feb 3rd, 2013, 10:56 PM
#7
Re: Flatten list problem - cannot be inferred from usage
 Originally Posted by jmcilhinney
Unless I'm missing something, that is only going to work for one level. You need to add some iteration or recursion if you want to support an arbitrary number of levels.
Yes: "Without a glance on how the structure of this "tree" is for each group/collection of items, anybody that gives you your solution could've just arrived there by luck."
You quoted and replied to this, so it didn't go without notice, but what you missed was my meaning behind why I posted that, before you took it into your own definition for what I meant.
 Originally Posted by jmcilhinney
Not really. A tree is a tree. If you're talking about a class that has a collection property of its own type then the pattern will be the same regardless of the actual definition of that class. The only thing that would change would be the type and member names.
You just said for yourself (in the same post) that it would only work for one level, so a tree is a tree, but as I said, It depends on the structure of the "tree". It can be many levels, or just one level... Please don't reply debating semantics that a tree is a tree regardless of it's levels, and the structure is still the same structure, just with different levels, because this is what I originally meant when I posted, when I referenced the "structure"; the levels or depth to the overall branches of the "tree".
For all we know without actually seeing the tree, it could just be a leftover stump, cut down many years ago with no branches. If I was to take this analogy further, it could be a spruce tree, an apple tree, etc... There's no telling the structure of the tree, just because "it's a tree", and the same thing applies here. 
If it was really complex with many branches and different numbers of branches in some areas, then he could introduce a recursive function to retrieve the items. But I still haven't gotten a clear picture of what data he's dealing with.
~Ace
Last edited by AceInfinity; Feb 3rd, 2013 at 11:08 PM.
<<<------------
.NET Programming (2012 - 2018)
®Crestron - DMC-T Certified Programmer | Software Developer <<<------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|