我有一个程序可以在 c# 中创建一个链表,如下所示:
class Point
{
public string Name { get; set; }
public List<Point> NextPoints { get; set; }
public Point()
{
NextPoints = new List<Point>();
}
}
这是具有名称和下一个点的点对象。
我用数据填充点列表,
List<Point> Points;
我在这里定义了一条线:
class DashedLine
{
public Point X { get; set; }
public Point Y { get; set; }
}
我需要一个递归函数来获取给定DashedLine的循环
这样我就传递了DashedLine对象,该函数返回一个构成循环的点列表。
请帮我做这个功能。