Home > Net >  About the tree structure with generics, online, etc
About the tree structure with generics, online, etc

Time:10-11

Everybody is good, recently I want to write a tree structure and generic to combine a thing
In my mind, there is a Tree and TreeNode two classes, Tree class to describe the whole Tree structure and the method, and the TreeNode class represents one of the nodes, but my node is want to apply to the future development of all kinds of classes, so want to use generics, now I'm more disorderly, don't know how to architecture, always not clear Tree, TreeNode with the combination of a generic for generic writing don't know,

And later I'll recursive and other commonly used integrated into the inside, and entrusted the event out in recursive personalized business, the following (code of writing is not necessarily correct, just want to clear my thoughts) : thank you all for a key point of the
 
The node Recurrence (T)
{
Foreach (nodeEach in node. Nodes)
{
Delegated events ing
Recurrence (nodeEach)
Delegated events Ed
}
}

CodePudding user response:

Their top,,,,,,,,,,,,,,,
  •  Tags:  
  • C#