Posts

Create a linked list using c#

Here,we will learn how to create a linked list using c#.A linked list is a dataStructure which has nodes.The node has data and next pointer.Here the elements are not stored in contiguous locations,they are linked using pointers. A linked list is represented by a pointer to the first node of linked list.The first node is called the head.If the list is empty,then value of head is NULL. In the below program,we are creating a linked list by adding items to its end. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LinkedLists {     public class Node     {         public int data;         public Node next;         public Node(int d)         {             data = d;             next = null;         }     } ...
Recent posts