Basic Operations in Linked List

  • AddFirst() – Adds node at the start of the List 
  • AddLast() – Adds node at the start of the List 
  • AddAfter() – Adds node after a particular Node
  • Remove() – Removes a particular node 
  • RemoveFirst() – Removes the first node
  • RemoveLast() -Removes the last node
  • Clear() – Removes all the nodes from the linked list
  • Find() – Find a particular node in the linked list
  • ToString() – To display all the elements of the linked list
  • Count – It returns the number of nodes in the linked list

How to Implement Generic Singly LinkedList in C#?

Linked List linear collection of objects called nodes that are stored in the memory at random addresses. The first node is a special node named Head which stores the address of the first element. In the last node of the linked list, the node may point at null or another special node named Tail. 

Similar Reads

Linked List Node Representation:

A node is an object which contains two fields, one stores data, and the other address of the next node....

Linked List Visualization:

The first node is a special node named Head which stores the address of the first element. In the last node of the linked list, the node may point at null or another special node named Tail....

Basic Operations in Linked List:

AddFirst() – Adds node at the start of the List  AddLast() – Adds node at the start of the List  AddAfter() – Adds node after a particular Node Remove() – Removes a particular node  RemoveFirst() – Removes the first node RemoveLast() -Removes the last node Clear() – Removes all the nodes from the linked list Find() – Find a particular node in the linked list ToString() – To display all the elements of the linked list Count – It returns the number of nodes in the linked list...

Generic:

In simple words generics allow users to work with any data type while writing a class or method....