我们在哪里可以找到开源的C#树形结构 [英] where can we find a open source c# tree structure

查看:76
本文介绍了我们在哪里可以找到开源的C#树形结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道.Net Framework中没有树结构,这很有趣,我认为树是最有用的数据结构之一.语法树,对象继承树和xml树,甚至.net都经常使用树,为什么不提供通用的树结构?

我找到了开源解决方案? 通用树< t>在C#中 [ ^ ]

还有吗?

I know there is not tree structure in .Net Framework, it''s interesting, I think the tree is one of most useful data strucutres. Syntax tree, object inheritance tree, and xml tree, even .net use tree that frequently, why don''t supply a common tree structure?

I have found a open source solution? Generic Tree <t> in C#[^]

Is there any more?

推荐答案

有一个: C#2.0中的通用树容器 [ ^ ]
这是:通用树集合 [ Google [
There is this one: Generic Tree Container in C# 2.0[^]
And this: A Generic Tree Collection[^]

But if you try googling, you will find loads more: Google[^]


我认为树形结构在标准.NET库中不可用,因为使用可用集合将其编写为一般需要几分钟的时间,肯定少于一个小时.

很难相信吗?

这是想法:

I think a tree structure is not available in standard .NET libraries because writing it using available collections suck as generic List would take… minutes, certainly less then an hour.

Hard to believe?

Here is the idea:

using NodeList = System.Collection.Generic.List<TreeNode>

class TreeNodeData {
   //later on you can make it a generic type
}
class TreeNode {
   TreeNodeData TreeNodeData;
   NodeList Children = new NodeList(); //here is where the recursive nature comes up
   //...   
}



明白了吗?

添加构造函数,访问器,操作,您就完成了!

—SA



Are you getting it?

Add constructor, accessors, operations and you''re done!

—SA


这篇关于我们在哪里可以找到开源的C#树形结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆