i want to run a infinite loop in c#. the structure i have is hirachical means every index have a list of same strucutre.
the thing look like
a person have their two child maybe the two child have two the loop is infinite how i can run them on aspx page.
any suggestion to do that
public struct mystruct{
public int ID;
public List<mystruct> childs
}
A proper recursive graph is not really possible with structs; you would need to change to a
class:The problem is that otherwise virtually every time you try to mutate them to create the cycle, you get a copy, not the same instance.
Since this is a mutable entity type, it should be a class anyway.
Then even something as simple as:
is a recursive graph.