配置树结构以使用字符串 [英] Configuring a tree structure to utilize with strings
本文介绍了配置树结构以使用字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试建立一个这样的树结构:首先输入的字符串是根,第二个是父,第三个是子。我不想创建二叉搜索树或类似的东西。理想情况下,我的树结构会占用字符串并显示树中的所有内容。
我熟悉编码二叉树,但这个实现不同。我只需要一些想法让我开始。
解决方案
我建议创建自己的类来表示二叉树,因为.NET中没有内置类树形结构操作。
您可以查看这些主题以查找更多详细信息:
http://stackoverflow.com/questions/942053/why-is-there-no-treet-class-网内
http:// stackoverflow的.com /问题/ 66893 /树的数据结构式-C-尖锐
I am trying to make a tree structure modeled like this: first-entered string is a "root", second one is a ‘parent’, and third one is a ‘child’. I don’t want to create a binary search tree, or anything similar. My tree structure would ideally take strings in account and show everything in the tree.
I am familiar with coding a binary tree, but this one is different for implementing. I just need some ideas to get me started.
解决方案
I suggest creating your own class that will represent binary tree, since there are no built-in classes in .NET for tree structure manipulation.
You can take a look at these threads to find more details:
http://stackoverflow.com/questions/942053/why-is-there-no-treet-class-in-net
http://stackoverflow.com/questions/66893/tree-data-structure-in-c-sharp
这篇关于配置树结构以使用字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文