C # program for the above approach
using System ; using System . Collections . Generic ; public class Node { public int data ; public Node next ; public Node ( ) { data = 0 ; next = null ; } } public class GFG {