dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; public class Node { public int data ; public Node next ; public Node ( int data ) { this . data = data ; } } public class GFG { private Node head ; public void printLL ( ) { Node t = head ; while ( t != null ) { Console . Write ( t . data + " ▁ - > " ) ; t = t . next ; } Console . WriteLine ( ) ; } public void swap ( Node a , Node b ) { if ( a == null b == null ) return ; int temp = a . data ; a . data = b . data ; b . data = temp ; } public Node zigZag ( Node node , int flag ) { if ( node == null node . next == null ) { return node ; } if ( flag == 0 ) { if ( node . data > node . next . data ) { swap ( node , node . next ) ; } return zigZag ( node . next , 1 ) ; } else { if ( node . data < node . next . data ) { swap ( node , node . next ) ; } return zigZag ( node . next , 0 ) ; } } public static void Main ( String [ ] args ) { GFG lobj = new GFG ( ) ; lobj . head = new Node ( 11 ) ; lobj . head . next = new Node ( 15 ) ; lobj . head . next . next = new Node ( 20 ) ; lobj . head . next . next . next = new Node ( 5 ) ; lobj . head . next . next . next . next = new Node ( 10 ) ; lobj . printLL ( ) ; int flag = 0 ; lobj . zigZag ( lobj . head , flag ) ; Console . WriteLine ( " LL ▁ in ▁ zig ▁ zag ▁ fashion ▁ : ▁ " ) ; lobj . printLL ( ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; class GfG { public class Node { public int data ; public Node next ; } public static Node newNode ( int data ) { Node new_node = new Node ( ) ; new_node . data = data ; new_node . next = null ; return new_node ; } public static int addWithCarry ( Node head ) { if ( head == null ) return 1 ; int res = head . data + addWithCarry ( head . next ) ; head . data = ( res ) % 10 ; return ( res ) / 10 ; } public static Node addOne ( Node head ) { int carry = addWithCarry ( head ) ; Node newNodes = null ; if ( carry > 0 ) { newNodes = newNode ( carry ) ; newNodes . next = head ; return newNodes ; } return head ; } public static void printList ( Node node ) { while ( node != null ) { Console . Write ( node . data ) ; node = node . next ; } Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { Node head = newNode ( 1 ) ; head . next = newNode ( 9 ) ; head . next . next = newNode ( 9 ) ; head . next . next . next = newNode ( 9 ) ; Console . Write ( " List ▁ is ▁ " ) ; printList ( head ) ; head = addOne ( head ) ; Console . WriteLine ( ) ; Console . Write ( " Resultant ▁ list ▁ is ▁ " ) ; printList ( head ) ; } }

Class/struct names: GfG, Node
C# program:
using System ; class GfG { class Node { public int data ; public Node next , arbit ; } static Node reverse ( Node head ) { Node prev = null , current = head , next = null ; while ( current != null ) { next = current . next ; current . next = prev ; prev = current ; current = next ; } return prev ; } static Node populateArbit ( Node head ) { head = reverse ( head ) ; Node max = head ; Node temp = head . next ; while ( temp != null ) { temp . arbit = max ; if ( max . data < temp . data ) max = temp ; temp = temp . next ; } return reverse ( head ) ; } static void printNextArbitPointers ( Node node ) { Console . WriteLine ( " Node TABSYMBOL Next ▁ Pointer TABSYMBOL Arbit ▁ Pointer " ) ; while ( node != null ) { Console . Write ( node . data + " TABSYMBOL TABSYMBOL " ) ; if ( node . next != null ) Console . Write ( node . next . data + " TABSYMBOL TABSYMBOL " ) ; else Console . Write ( " NULL " + " TABSYMBOL TABSYMBOL " ) ; if ( node . arbit != null ) Console . Write ( node . arbit . data ) ; else Console . Write ( " NULL " ) ; Console . WriteLine ( ) ; node = node . next ; } } static Node newNode ( int data ) { Node new_node = new Node ( ) ; new_node . data = data ; new_node . next = null ; return new_node ; } public static void Main ( String [ ] args ) { Node head = newNode ( 5 ) ; head . next = newNode ( 10 ) ; head . next . next = newNode ( 2 ) ; head . next . next . next = newNode ( 3 ) ; head = populateArbit ( head ) ; Console . WriteLine ( " Resultant ▁ Linked ▁ List ▁ is : ▁ " ) ; printNextArbitPointers ( head ) ; } }

Class/struct names: GfG, Node
C# program:
using System ; class GfG { public class Node { public int data ; public Node next , arbit ; } static Node maxNode ; static void populateArbit ( Node head ) { if ( head == null ) return ; if ( head . next == null ) { maxNode = head ; return ; } populateArbit ( head . next ) ; head . arbit = maxNode ; if ( head . data > maxNode . data ) maxNode = head ; return ; } static void printNextArbitPointers ( Node node ) { Console . WriteLine ( " Node TABSYMBOL Next ▁ Pointer TABSYMBOL Arbit ▁ Pointer " ) ; while ( node != null ) { Console . Write ( node . data + " TABSYMBOL TABSYMBOL TABSYMBOL " ) ; if ( node . next != null ) Console . Write ( node . next . data + " TABSYMBOL TABSYMBOL TABSYMBOL TABSYMBOL " ) ; else Console . Write ( " NULL " + " TABSYMBOL TABSYMBOL TABSYMBOL " ) ; if ( node . arbit != null ) Console . Write ( node . arbit . data ) ; else Console . Write ( " NULL " ) ; Console . WriteLine ( ) ; node = node . next ; } } static Node newNode ( int data ) { Node new_node = new Node ( ) ; new_node . data = data ; new_node . next = null ; return new_node ; } public static void Main ( String [ ] args ) { Node head = newNode ( 5 ) ; head . next = newNode ( 10 ) ; head . next . next = newNode ( 2 ) ; head . next . next . next = newNode ( 3 ) ; populateArbit ( head ) ; Console . WriteLine ( " Resultant ▁ Linked ▁ List ▁ is : ▁ " ) ; printNextArbitPointers ( head ) ; } }

Class/struct names: GfG, Node
C# program:
using System ; class Node { public String data ; public Node next ; public Node ( String d ) { data = d ; next = null ; } } public class LinkedList_Palindrome { Node head ; bool isPalidromeUtil ( String str ) { int length = str . Length ; for ( int i = 0 ; i < length / 2 ; i ++ ) if ( str [ i ] != str [ length - i - 1 ] ) return false ; return true ; } bool isPalindrome ( ) { Node node = head ; String str = " " ; while ( node != null ) { str = str + ( node . data ) ; node = node . next ; } return isPalidromeUtil ( str ) ; } public static void Main ( String [ ] args ) { LinkedList_Palindrome list = new LinkedList_Palindrome ( ) ; list . head = new Node ( " a " ) ; list . head . next = new Node ( " bc " ) ; list . head . next . next = new Node ( " d " ) ; list . head . next . next . next = new Node ( " dcb " ) ; list . head . next . next . next . next = new Node ( " a " ) ; Console . WriteLine ( list . isPalindrome ( ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: LinkedList_Palindrome, Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static void deleteLast ( Node head , int x ) { Node temp = head , ptr = null ; while ( temp != null ) { if ( temp . data == x ) ptr = temp ; temp = temp . next ; } if ( ptr != null && ptr . next == null ) { temp = head ; while ( temp . next != ptr ) temp = temp . next ; temp . next = null ; } if ( ptr != null && ptr . next != null ) { ptr . data = ptr . next . data ; temp = ptr . next ; ptr . next = ptr . next . next ; } } static Node newNode ( int x ) { Node node = new Node ( ) ; node . data = x ; node . next = null ; return node ; } static void display ( Node head ) { Node temp = head ; if ( head == null ) { Console . Write ( " null STRNEWLINE " ) ; return ; } while ( temp != null ) { Console . Write ( " { 0 } ▁ - - > ▁ " , temp . data ) ; temp = temp . next ; } Console . Write ( " null STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { Node head = newNode ( 1 ) ; head . next = newNode ( 2 ) ; head . next . next = newNode ( 3 ) ; head . next . next . next = newNode ( 4 ) ; head . next . next . next . next = newNode ( 5 ) ; head . next . next . next . next . next = newNode ( 4 ) ; head . next . next . next . next . next . next = newNode ( 4 ) ; Console . Write ( " Created ▁ Linked ▁ list : ▁ " ) ; display ( head ) ; deleteLast ( head , 4 ) ; Console . Write ( " List ▁ after ▁ deletion ▁ of ▁ 4 : ▁ " ) ; display ( head ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; public class GfG { public class Node { public int data ; public Node next ; } static Node newNode ( int data ) { Node new_node = new Node ( ) ; new_node . data = data ; new_node . next = null ; return new_node ; } static Node partition ( Node head , int x ) { Node smallerHead = null , smallerLast = null ; Node greaterLast = null , greaterHead = null ; Node equalHead = null , equalLast = null ; while ( head != null ) { if ( head . data == x ) { if ( equalHead == null ) equalHead = equalLast = head ; else { equalLast . next = head ; equalLast = equalLast . next ; } } else if ( head . data < x ) { if ( smallerHead == null ) smallerLast = smallerHead = head ; else { smallerLast . next = head ; smallerLast = head ; } } else { if ( greaterHead == null ) greaterLast = greaterHead = head ; else { greaterLast . next = head ; greaterLast = head ; } } head = head . next ; } if ( greaterLast != null ) greaterLast . next = null ; if ( smallerHead == null ) { if ( equalHead == null ) return greaterHead ; equalLast . next = greaterHead ; return equalHead ; } if ( equalHead == null ) { smallerLast . next = greaterHead ; return smallerHead ; } smallerLast . next = equalHead ; equalLast . next = greaterHead ; return smallerHead ; } static void printList ( Node head ) { Node temp = head ; while ( temp != null ) { Console . Write ( temp . data + " ▁ " ) ; temp = temp . next ; } } public static void Main ( ) { Node head = newNode ( 10 ) ; head . next = newNode ( 4 ) ; head . next . next = newNode ( 5 ) ; head . next . next . next = newNode ( 30 ) ; head . next . next . next . next = newNode ( 2 ) ; head . next . next . next . next . next = newNode ( 50 ) ; int x = 3 ; head = partition ( head , x ) ; printList ( head ) ; } }

Class/struct names: GfG, Node
C# program:
using System ; using System . Collections . Generic ; class GfG { class Node { public int data ; public Node next ; } static Node getLoopstart ( Node loop_node , Node head ) { Node ptr1 = loop_node ; Node ptr2 = loop_node ; int k = 1 , i ; while ( ptr1 . next != ptr2 ) { ptr1 = ptr1 . next ; k ++ ; } ptr1 = head ; ptr2 = head ; for ( i = 0 ; i < k ; i ++ ) ptr2 = ptr2 . next ; while ( ptr2 != ptr1 ) { ptr1 = ptr1 . next ; ptr2 = ptr2 . next ; } return ptr1 ; } static Node detectAndgetLoopstarting ( Node head ) { Node slow_p = head , fast_p = head , loop_start = null ; while ( slow_p != null && fast_p != null && fast_p . next != null ) { slow_p = slow_p . next ; fast_p = fast_p . next . next ; if ( slow_p == fast_p ) { loop_start = getLoopstart ( slow_p , head ) ; break ; } } return loop_start ; } static bool isPalindromeUtil ( Node head , Node loop_start ) { Node ptr = head ; Stack < int > s = new Stack < int > ( ) ; int count = 0 ; while ( ptr != loop_start count != 1 ) { s . Push ( ptr . data ) ; if ( ptr == loop_start ) count = 1 ; ptr = ptr . next ; } ptr = head ; count = 0 ; while ( ptr != loop_start count != 1 ) { if ( ptr . data == s . Peek ( ) ) s . Pop ( ) ; else return false ; if ( ptr == loop_start ) count = 1 ; ptr = ptr . next ; } return true ; } static bool isPalindrome ( Node head ) { Node loop_start = detectAndgetLoopstarting ( head ) ; return isPalindromeUtil ( head , loop_start ) ; } static Node newNode ( int key ) { Node temp = new Node ( ) ; temp . data = key ; temp . next = null ; return temp ; } public static void Main ( String [ ] args ) { Node head = newNode ( 50 ) ; head . next = newNode ( 20 ) ; head . next . next = newNode ( 15 ) ; head . next . next . next = newNode ( 20 ) ; head . next . next . next . next = newNode ( 50 ) ; head . next . next . next . next . next = head . next . next ; if ( isPalindrome ( head ) == true ) Console . WriteLine ( " Palindrome " ) ; else Console . WriteLine ( " Not ▁ Palindrome " ) ; } }

Accumulator variables: i, k
Iterator variables: i
Class/struct names: GfG, Node
C# program:
using System ; class GfG { public class Node { public int data ; public Node next ; } static int countCommon ( Node a , Node b ) { int count = 0 ; for ( ; a != null && b != null ; a = a . next , b = b . next ) if ( a . data == b . data ) ++ count ; else break ; return count ; } static int maxPalindrome ( Node head ) { int result = 0 ; Node prev = null , curr = head ; while ( curr != null ) { Node next = curr . next ; curr . next = prev ; result = Math . Max ( result , 2 * countCommon ( prev , next ) + 1 ) ; result = Math . Max ( result , 2 * countCommon ( curr , next ) ) ; prev = curr ; curr = next ; } return result ; } static Node newNode ( int key ) { Node temp = new Node ( ) ; temp . data = key ; temp . next = null ; return temp ; } public static void Main ( String [ ] args ) { Node head = newNode ( 2 ) ; head . next = newNode ( 4 ) ; head . next . next = newNode ( 3 ) ; head . next . next . next = newNode ( 4 ) ; head . next . next . next . next = newNode ( 2 ) ; head . next . next . next . next . next = newNode ( 15 ) ; Console . WriteLine ( maxPalindrome ( head ) ) ; } }

Class/struct names: GfG, Node
C# program:
using System ; using System . Collections . Generic ; public class GFG { public static void Main ( String [ ] args ) { List < int > list = new List < int > ( ) ; list . Add ( 1 ) ; list . Add ( 2 ) ; list . Add ( 3 ) ; foreach ( int it in list ) { Console . Write ( it + " ▁ " ) ; } } }

Iterator variables: it
Class/struct names: GFG
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } static Node newNode ( int x ) { Node temp = new Node ( ) ; temp . data = x ; temp . next = null ; return temp ; } static void printList ( Node head ) { Node temp = head ; while ( temp != null ) { Console . Write ( " { 0 } ▁ " , temp . data ) ; temp = temp . next ; } Console . Write ( " STRNEWLINE " ) ; } static void moveToEnd ( Node head , int key ) { Node pKey = head ; Node pCrawl = head ; while ( pCrawl != null ) { if ( pCrawl != pKey && pCrawl . data != key ) { pKey . data = pCrawl . data ; pCrawl . data = key ; pKey = pKey . next ; } if ( pKey . data != key ) pKey = pKey . next ; pCrawl = pCrawl . next ; } } public static void Main ( String [ ] args ) { Node head = newNode ( 10 ) ; head . next = newNode ( 20 ) ; head . next . next = newNode ( 10 ) ; head . next . next . next = newNode ( 30 ) ; head . next . next . next . next = newNode ( 40 ) ; head . next . next . next . next . next = newNode ( 10 ) ; head . next . next . next . next . next . next = newNode ( 60 ) ; Console . Write ( " Before ▁ moveToEnd ( ) , ▁ the ▁ Linked ▁ list ▁ is STRNEWLINE " ) ; printList ( head ) ; int key = 10 ; moveToEnd ( head , key ) ; Console . Write ( " moveToEnd ( ) , the Linked is " printList ( head ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; public class Node { public int data ; public Node next ; public Node ( int data ) { this . data = data ; this . next = null ; } } class GFG { static Node root ; public static Node keyToEnd ( Node head , int key ) { Node tail = head ; if ( head == null ) { return null ; } while ( tail . next != null ) { tail = tail . next ; } Node last = tail ; Node current = head ; Node prev = null ; Node prev2 = null ; while ( current != tail ) { if ( current . data == key && prev2 == null ) { prev = current ; current = current . next ; head = current ; last . next = prev ; last = last . next ; last . next = null ; prev = null ; } else { if ( current . data == key && prev2 != null ) { prev = current ; current = current . next ; prev2 . next = current ; last . next = prev ; last = last . next ; last . next = null ; } else if ( current != tail ) { prev2 = current ; current = current . next ; } } } return head ; } public static void display ( Node root ) { while ( root != null ) { Console . Write ( root . data + " ▁ " ) ; root = root . next ; } } public static void Main ( ) { root = new Node ( 5 ) ; root . next = new Node ( 2 ) ; root . next . next = new Node ( 2 ) ; root . next . next . next = new Node ( 7 ) ; root . next . next . next . next = new Node ( 2 ) ; root . next . next . next . next . next = new Node ( 2 ) ; root . next . next . next . next . next . next = new Node ( 2 ) ; int key = 2 ; Console . WriteLine ( " Linked ▁ List ▁ before ▁ operations ▁ : " ) ; display ( root ) ; Console . WriteLine ( " operations : " root = keyToEnd ( root , key ) ; display ( root ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; public class LinkedList { Node head = null ; class Node { public int val ; public Node next ; public Node ( int v ) { val = v ; next = null ; } } public void insert ( int data ) { Node new_node = new Node ( data ) ; new_node . next = head ; head = new_node ; } public void removeAllDuplicates ( ) { Node dummy = new Node ( 0 ) ; dummy . next = head ; Node prev = dummy ; Node current = head ; while ( current != null ) { while ( current . next != null && prev . next . val == current . next . val ) current = current . next ; if ( prev . next == current ) prev = prev . next ; else prev . next = current . next ; current = current . next ; } head = dummy . next ; } public void printList ( ) { Node trav = head ; if ( head == null ) Console . Write ( " ▁ List ▁ is ▁ empty " ) ; while ( trav != null ) { Console . Write ( trav . val + " ▁ " ) ; trav = trav . next ; } } public static void Main ( String [ ] args ) { LinkedList ll = new LinkedList ( ) ; ll . insert ( 53 ) ; ll . insert ( 53 ) ; ll . insert ( 49 ) ; ll . insert ( 49 ) ; ll . insert ( 35 ) ; ll . insert ( 28 ) ; ll . insert ( 28 ) ; ll . insert ( 23 ) ; Console . WriteLine ( " Before ▁ removal ▁ of ▁ duplicates " ) ; ll . printList ( ) ; ll . removeAllDuplicates ( ) ; Console . WriteLine ( " STRNEWLINE After ▁ removal ▁ of ▁ duplicates " ) ; ll . printList ( ) ; } }

Class/struct names: LinkedList, Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } static Node freeList ( Node node ) { while ( node != null ) { Node next = node . next ; node = next ; } return node ; } static Node deleteKthNode ( Node head , int k ) { if ( head == null ) return null ; if ( k == 1 ) { head = freeList ( head ) ; return null ; } Node ptr = head , prev = null ; int count = 0 ; while ( ptr != null ) { count ++ ; if ( k == count ) { prev . next = ptr . next ; count = 0 ; } if ( count != 0 ) prev = ptr ; ptr = prev . next ; } return head ; } static void displayList ( Node head ) { Node temp = head ; while ( temp != null ) { Console . Write ( temp . data + " ▁ " ) ; temp = temp . next ; } } static Node newNode ( int x ) { Node temp = new Node ( ) ; temp . data = x ; temp . next = null ; return temp ; } public static void Main ( String [ ] args ) { Node head = newNode ( 1 ) ; head . next = newNode ( 2 ) ; head . next . next = newNode ( 3 ) ; head . next . next . next = newNode ( 4 ) ; head . next . next . next . next = newNode ( 5 ) ; head . next . next . next . next . next = newNode ( 6 ) ; head . next . next . next . next . next . next = newNode ( 7 ) ; head . next . next . next . next . next . next . next = newNode ( 8 ) ; int k = 3 ; head = deleteKthNode ( head , k ) ; displayList ( head ) ; } }

Accumulator variables: count
Class/struct names: GFG, Node
C# program:
using System ; class GfG { class Node { public int data ; public Node next ; } static int LinkedListLength ( Node head ) { while ( head != null && head . next != null ) { head = head . next . next ; } if ( head == null ) return 0 ; return 1 ; } static void push ( Node head , int info ) { Node node = new Node ( ) ; node . data = info ; node . next = ( head ) ; ( head ) = node ; } public static void Main ( ) { Node head = null ; push ( head , 4 ) ; push ( head , 5 ) ; push ( head , 7 ) ; push ( head , 2 ) ; push ( head , 9 ) ; push ( head , 6 ) ; push ( head , 1 ) ; push ( head , 2 ) ; push ( head , 0 ) ; push ( head , 5 ) ; push ( head , 5 ) ; int check = LinkedListLength ( head ) ; if ( check == 0 ) { Console . WriteLine ( " Odd " ) ; } else { Console . WriteLine ( " Even " ) ; } } }

Class/struct names: GfG, Node
C# program:
using System ; using System . Collections . Generic ; class GFG { class Node { public int data ; public Node next ; } ; static Node push ( Node head_ref , int new_data ) { Node new_node = new Node ( ) ; new_node . data = new_data ; new_node . next = head_ref ; head_ref = new_node ; return head_ref ; } static int sumOfLastN_NodesUtil ( Node head , int n ) { if ( n <= 0 ) return 0 ; Stack < int > st = new Stack < int > ( ) ; int sum = 0 ; while ( head != null ) { st . Push ( head . data ) ; head = head . next ; } while ( n -- > 0 ) { sum += st . Peek ( ) ; st . Pop ( ) ; } return sum ; } public static void Main ( String [ ] args ) { Node head = null ; head = push ( head , 12 ) ; head = push ( head , 4 ) ; head = push ( head , 8 ) ; head = push ( head , 6 ) ; head = push ( head , 10 ) ; int n = 2 ; Console . Write ( " Sum ▁ of ▁ last ▁ " + n + " ▁ nodes ▁ = ▁ " + sumOfLastN_NodesUtil ( head , n ) ) ; } }

Accumulator variables: n, sum
Class/struct names: GFG, Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static Node head ; static void push ( Node head_ref , int new_data ) { Node new_node = new Node ( ) ; new_node . data = new_data ; new_node . next = head_ref ; head_ref = new_node ; head = head_ref ; } static void reverseList ( Node head_ref ) { Node current , prev , next ; current = head_ref ; prev = null ; while ( current != null ) { next = current . next ; current . next = prev ; prev = current ; current = next ; } head_ref = prev ; head = head_ref ; } static int sumOfLastN_NodesUtil ( int n ) { if ( n <= 0 ) return 0 ; reverseList ( head ) ; int sum = 0 ; Node current = head ; while ( current != null && n -- > 0 ) { sum += current . data ; current = current . next ; } reverseList ( head ) ; return sum ; } public static void Main ( String [ ] args ) { push ( head , 12 ) ; push ( head , 4 ) ; push ( head , 8 ) ; push ( head , 6 ) ; push ( head , 10 ) ; int n = 2 ; Console . WriteLine ( " Sum ▁ of ▁ last ▁ " + n + " ▁ nodes ▁ = ▁ " + sumOfLastN_NodesUtil ( n ) ) ; } }

Accumulator variables: n, sum
Class/struct names: GFG, Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static Node head ; static void push ( Node head_ref , int new_data ) { Node new_node = new Node ( ) ; new_node . data = new_data ; new_node . next = head_ref ; head_ref = new_node ; head = head_ref ; } static int sumOfLastN_NodesUtil ( Node head , int n ) { if ( n <= 0 ) return 0 ; int sum = 0 , len = 0 ; Node temp = head ; while ( temp != null ) { len ++ ; temp = temp . next ; } int c = len - n ; temp = head ; while ( temp != null && c -- > 0 ) { temp = temp . next ; } while ( temp != null ) { sum += temp . data ; temp = temp . next ; } return sum ; } public static void Main ( String [ ] args ) { push ( head , 12 ) ; push ( head , 4 ) ; push ( head , 8 ) ; push ( head , 6 ) ; push ( head , 10 ) ; int n = 2 ; Console . WriteLine ( " Sum ▁ of ▁ last ▁ " + n + " ▁ nodes ▁ = ▁ " + sumOfLastN_NodesUtil ( head , n ) ) ; } }

Accumulator variables: c, len, sum
Class/struct names: GFG, Node