I asked a question about linked lists... I think I got misunderstood... I am currently studying Linked List and I get the concept but I am a little confused in the implementation for the nodes.
public class Node
{
public Node Next;
public object Value;
}
How can you use the "public Node Next;" inside the class node. In other words how is it possible to use the object Next of type Node when you are declaring the Node itself?.... It is like recursion... And yes i know that recursion is a method calling itself ... But in this situation it is a object of the same class being created inside the class itself... That is why i say it is recursion-like
Next == nulland it stops.Nextproperty you get a reference to the nextNodeinstance. But this will not automatically call it'sNext-property. So have to call it yourself, for example:object val = node.Next?.Next?.Value;