如何使用F#从给定的数据制作树 [英] how to make a tree from a given data with F#
问题描述
有人可以教我如何使用F#从给定的数据制作一棵树吗?例如:数字列表或城市名称列表等.我不知道如何在F#中制作树,这里需要帮助:)
can somebody teach me how to make a tree from a given data using F#? for example: a list of numbers or a list of city's name and etc . I don't have any clue how to make tree in F#, need help here :)
例如: 输入来自运行时,假设它来自文本文件:城市的列表名称
for example: the input is from run-time, assume it's from a text file: a list name of city
输出结果:图
推荐答案
Wikipedia具有搜索堆栈溢出.树实现中存在很多问题.这里有一些.
Wikipedia has a list of common ways graph data is represented which should help you if you're trying to load graph data from a file. Once you have loaded the data search Stack Overflow. There are plenty of questions with tree implementations in them. Here are a few.
- Help Needed Creating a Binary Tree Given Truth Table
- Help in designing a tree structure - Tension between functional and OOP
- Pretty print a tree
- F#: Recursive collect and filter over N-ary Tree
- What's wrong with my tree traversal code?
这篇关于如何使用F#从给定的数据制作树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!