.Net 集合:节点叶
是否有一个内置的类似节点的集合,可以让我在信息中存储信息,而无需构建长而难以阅读的通用声明?
C# 或 VB.Net 解决方案将不胜感激。
例如:
dim base as new Dictionary(of String, Dictionary(of String, List(of String)))
dim mid as new Dictionary(of String, List(of String)
dim leaf as new List(of String)
leaf.add("leaf1")
leaf.add("leaf2")
mid.add("middle", leaf)
base.add("base", mid)
逻辑表示:
/ leaf
mid - leaf
/ \ leaf
base
\ / leaf
mid - leaf
\ leaf
Is there a built in node-like collection that will allow me to store information within information without building long hard to read generic declarations?
C# or VB.Net solutions would be appreciated.
For example:
dim base as new Dictionary(of String, Dictionary(of String, List(of String)))
dim mid as new Dictionary(of String, List(of String)
dim leaf as new List(of String)
leaf.add("leaf1")
leaf.add("leaf2")
mid.add("middle", leaf)
base.add("base", mid)
Logical Representation:
/ leaf
mid - leaf
/ \ leaf
base
\ / leaf
mid - leaf
\ leaf
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有内置任何东西。看看这个。
Nothing built in. Take a look at this.
没有任何内置的东西,您最好为每个树节点构建自己的类。
并且只有一个私有泛型类!
There is nothing builtin, you're probably better off building your own class for each tree node.
And only one private generic class!