dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; public class Test { public static bool isRotated ( string str1 , string str2 ) { if ( str1 . Length != str2 . Length ) { return false ; } if ( str1 . Length < 2 ) { return str1 . Equals ( str2 ) ; } string clock_rot = " " ; string anticlock_rot = " " ; int len = str2 . Length ; anticlock_rot = anticlock_rot + str2 . Substring ( len - 2 , len - ( len - 2 ) ) + str2 . Substring ( 0 , len - 2 ) ; clock_rot = clock_rot + str2 . Substring ( 2 ) + str2 . Substring ( 0 , 2 ) ; return ( str1 . Equals ( clock_rot ) || str1 . Equals ( anticlock_rot ) ) ; } public static void Main ( string [ ] args ) { string str1 = " geeks " ; string str2 = " eksge " ; Console . WriteLine ( isRotated ( str1 , str2 ) ? " Yes " : " No " ) ; } }

Class/struct names: Test
C# program:
using System ; class GFG { static String minLexRotation ( String str ) { int n = str . Length ; String [ ] arr = new String [ n ] ; String concat = str + str ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = concat . Substring ( i , n ) ; } Array . Sort ( arr ) ; return arr [ 0 ] ; } public static void Main ( String [ ] args ) { Console . WriteLine ( minLexRotation ( " GEEKSFORGEEKS " ) ) ; Console . WriteLine ( minLexRotation ( " GEEKSQUIZ " ) ) ; Console . WriteLine ( minLexRotation ( " BCABDADAB " ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class Node { public int data ; public Node next ; public Node ( int data ) { this . data = data ; this . next = null ; } } class GFG { static Node head ; static void print ( Node head ) { Node temp = head ; while ( temp != null ) { Console . Write ( temp . data + " ▁ " ) ; temp = temp . next ; } } static void NextGreaterElement ( Node head ) { Node H = head ; Node res = null ; Node tempList = null ; do { Node curr = head ; int Val = - 1 ; do { if ( head . data < curr . data ) { Val = curr . data ; break ; } curr = curr . next ; } while ( curr != head ) ; if ( res == null ) { res = new Node ( Val ) ; tempList = res ; } else { tempList . next = new Node ( Val ) ; tempList = tempList . next ; } head = head . next ; } while ( head != H ) ; print ( res ) ; } static public void Main ( ) { head = new Node ( 1 ) ; head . next = new Node ( 5 ) ; head . next . next = new Node ( 12 ) ; head . next . next . next = new Node ( 10 ) ; head . next . next . next . next = new Node ( 0 ) ; head . next . next . next . next . next = head ; NextGreaterElement ( head ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static void printList ( Node n ) { while ( n != null ) { Console . Write ( n . data + " ▁ " ) ; n = n . next ; } } public static void Main ( String [ ] args ) { Node head = null ; Node second = null ; Node third = null ; head = new Node ( ) ; second = new Node ( ) ; third = new Node ( ) ; head . data = 1 ; head . next = second ; second . data = 2 ; second . next = third ; third . data = 3 ; third . next = null ; printList ( head ) ; } }

Class/struct names: GFG, Node
C# program:
public class Node { public int data ; public Node next ; public Node prev ; } ;

Class/struct names: Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static Node push ( Node head_ref , int data ) { Node ptr1 = new Node ( ) ; Node temp = head_ref ; ptr1 . data = data ; ptr1 . next = head_ref ; if ( head_ref != null ) { while ( temp . next != head_ref ) temp = temp . next ; temp . next = ptr1 ; } else ptr1 . next = ptr1 ; head_ref = ptr1 ; return head_ref ; } static void deleteNode ( Node head_ref , Node del ) { if ( head_ref == del ) head_ref = del . next ; Node temp = head_ref ; while ( temp . next != del ) { temp = temp . next ; } temp . next = del . next ; return ; } static bool isEvenParity ( int x ) { int parity = 0 ; while ( x != 0 ) { if ( ( x & 1 ) != 0 ) parity ++ ; x = x >> 1 ; } if ( parity % 2 == 0 ) return true ; else return false ; } static void deleteEvenParityNodes ( Node head ) { if ( head == null ) return ; if ( head == head . next ) { if ( isEvenParity ( head . data ) ) head = null ; return ; } Node ptr = head ; Node next ; do { next = ptr . next ; if ( isEvenParity ( ptr . data ) ) deleteNode ( head , ptr ) ; ptr = next ; } while ( ptr != head ) ; if ( head == head . next ) { if ( isEvenParity ( head . data ) ) head = null ; return ; } } static void printList ( Node head ) { if ( head == null ) { Console . Write ( " Empty ▁ List STRNEWLINE " ) ; return ; } Node temp = head ; if ( head != null ) { do { Console . Write ( temp . data + " ▁ " ) ; temp = temp . next ; } while ( temp != head ) ; } } public static void Main ( String [ ] args ) { Node head = null ; head = push ( head , 21 ) ; head = push ( head , 13 ) ; head = push ( head , 6 ) ; head = push ( head , 34 ) ; head = push ( head , 9 ) ; head = push ( head , 11 ) ; deleteEvenParityNodes ( head ) ; printList ( head ) ; } }

Accumulator variables: parity
Class/struct names: GFG, Node
C# program:
using System ; class GFG { class Node { public int data ; public Node next ; } ; static Node push ( Node head_ref , int data ) { Node ptr1 = new Node ( ) ; Node temp = head_ref ; ptr1 . data = data ; ptr1 . next = head_ref ; if ( head_ref != null ) { while ( temp . next != head_ref ) temp = temp . next ; temp . next = ptr1 ; } else ptr1 . next = ptr1 ; head_ref = ptr1 ; return head_ref ; } static void deleteNode ( Node head_ref , Node del ) { Node temp = head_ref ; if ( head_ref == del ) head_ref = del . next ; while ( temp . next != del ) { temp = temp . next ; } temp . next = del . next ; del = null ; return ; } static int digitSum ( int num ) { int sum = 0 ; while ( num > 0 ) { sum += ( num % 10 ) ; num /= 10 ; } return sum ; } static void deleteEvenDigitSumNodes ( Node head ) { Node ptr = head ; Node next ; do { if ( ! ( digitSum ( ptr . data ) % 2 == 1 ) ) deleteNode ( head , ptr ) ; next = ptr . next ; ptr = next ; } while ( ptr != head ) ; } static void printList ( Node head ) { Node temp = head ; if ( head != null ) { do { Console . Write ( " { 0 } ▁ " , temp . data ) ; temp = temp . next ; } while ( temp != head ) ; } } public static void Main ( String [ ] args ) { Node head = null ; head = push ( head , 21 ) ; head = push ( head , 13 ) ; head = push ( head , 6 ) ; head = push ( head , 34 ) ; head = push ( head , 11 ) ; head = push ( head , 9 ) ; deleteEvenDigitSumNodes ( head ) ; printList ( head ) ; } }

Accumulator variables: num, sum
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 data ) { Node ptr1 = new Node ( ) ; Node temp = head_ref ; ptr1 . data = data ; ptr1 . next = head_ref ; if ( head_ref != null ) { while ( temp . next != head_ref ) temp = temp . next ; temp . next = ptr1 ; } else ptr1 . next = ptr1 ; head_ref = ptr1 ; return head_ref ; } static void deleteNode ( Node head_ref , Node del ) { Node temp = head_ref ; if ( head_ref == del ) head_ref = del . next ; while ( temp . next != del ) { temp = temp . next ; } temp . next = del . next ; del = null ; return ; } static int largestElement ( Node head_ref ) { Node current ; current = head_ref ; int maxEle = int . MinValue ; do { if ( current . data > maxEle ) { maxEle = current . data ; } current = current . next ; } while ( current != head_ref ) ; return maxEle ; } static void createHash ( HashSet < int > hash , int maxElement ) { int prev = 0 , curr = 1 ; hash . Add ( prev ) ; hash . Add ( curr ) ; while ( curr <= maxElement ) { int temp = curr + prev ; hash . Add ( temp ) ; prev = curr ; curr = temp ; } } static void deleteFibonacciNodes ( Node head ) { int maxEle = largestElement ( head ) ; HashSet < int > hash = new HashSet < int > ( ) ; createHash ( hash , maxEle ) ; Node ptr = head ; Node next ; do { if ( hash . Contains ( ptr . data ) ) deleteNode ( head , ptr ) ; next = ptr . next ; ptr = next ; } while ( ptr != head ) ; } static void printList ( Node head ) { Node temp = head ; if ( head != null ) { do { Console . Write ( " { 0 } ▁ " , temp . data ) ; temp = temp . next ; } while ( temp != head ) ; } } public static void Main ( String [ ] args ) { Node head = null ; head = push ( head , 20 ) ; head = push ( head , 13 ) ; head = push ( head , 6 ) ; head = push ( head , 34 ) ; head = push ( head , 11 ) ; head = push ( head , 9 ) ; deleteFibonacciNodes ( head ) ; printList ( head ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static Node push ( Node head_ref , int data ) { Node ptr1 = new Node ( ) ; Node temp = head_ref ; ptr1 . data = data ; ptr1 . next = head_ref ; if ( head_ref != null ) { while ( temp . next != head_ref ) temp = temp . next ; temp . next = ptr1 ; return head_ref ; } else ptr1 . next = ptr1 ; head_ref = ptr1 ; return head_ref ; } static Node deleteNode ( Node head_ref , Node del ) { Node temp = head_ref ; if ( head_ref == del ) head_ref = del . next ; while ( temp . next != del ) { temp = temp . next ; } temp . next = del . next ; return head_ref ; } static Node deleteoddNodes ( Node head ) { Node ptr = head ; Node next ; do { if ( ptr . data % 2 == 1 ) deleteNode ( head , ptr ) ; next = ptr . next ; ptr = next ; } while ( ptr != head ) ; return head ; } static void printList ( Node head ) { Node temp = head ; if ( head != null ) { do { Console . Write ( " { 0 } ▁ " , temp . data ) ; temp = temp . next ; } while ( temp != head ) ; } } public static void Main ( String [ ] args ) { Node head = null ; head = push ( head , 2 ) ; head = push ( head , 12 ) ; head = push ( head , 11 ) ; head = push ( head , 57 ) ; head = push ( head , 61 ) ; head = push ( head , 56 ) ; Console . WriteLine ( " STRNEWLINE List ▁ after ▁ deletion ▁ : ▁ " ) ; head = deleteoddNodes ( head ) ; printList ( head ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; class GFG { public class Node { public Node next ; public int data ; } ; static Node create ( ) { Node new_node = new Node ( ) ; new_node . next = null ; return new_node ; } static Node find_head ( Node random ) { if ( random == null ) return null ; Node var = random ; while ( ! ( var . data > var . next . data var . next == random ) ) { var = var . ; } return var . next ; } static Node sortedInsert ( Node head_ref , Node new_node ) { Node current = head_ref ; if ( current == null ) { new_node . next = new_node ; head_ref = new_node ; } else if ( current . data >= new_node . data ) { while ( current . next != head_ref ) current = current . next ; current . next = new_node ; new_node . next = head_ref ; head_ref = new_node ; } else { while ( current . next != head_ref && current . next . data < new_node . data ) { current = current . next ; } new_node . next = current . next ; current . next = new_node ; } return head_ref ; } static void printList ( Node start ) { Node temp ; if ( start != null ) { temp = start ; do { Console . Write ( temp . data + " ▁ " ) ; temp = temp . next ; } while ( temp != start ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 12 , 56 , 2 , 11 , 1 , 90 } ; int i ; Node start = null ; Node temp ; for ( i = 0 ; i < 6 ; i ++ ) { if ( start != null ) for ( int j = 0 ; j < ( new Random ( ) . Next ( ) * 10 ) ; j ++ ) start = start . next ; temp = create ( ) ; temp . data = arr [ i ] ; start = sortedInsert ( find_head ( start ) , temp ) ; } printList ( find_head ( start ) ) ; } }

Index/key variables: i
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG, Node
C# program:
using System ; public class CircularLinkedList { public Node last ; public class Node { public int data ; public Node next ; } ; public Node addToEmpty ( int data ) { if ( this . last != null ) return this . last ; Node temp = new Node ( ) ; temp . data = data ; this . last = temp ; this . last . next = this . last ; return last ; } public Node addBegin ( int data ) { if ( last == null ) return addToEmpty ( data ) ; Node temp = new Node ( ) ; temp . data = data ; temp . next = this . last . next ; this . last . next = temp ; return this . last ; } public void traverse ( ) { Node p ; if ( this . last == null ) { Console . WriteLine ( " List ▁ is ▁ empty . " ) ; return ; } p = this . last . next ; do { Console . Write ( p . data + " ▁ " ) ; p = p . next ; } while ( p != this . last . next ) ; Console . WriteLine ( " " ) ; } public int length ( ) { int x = 0 ; if ( this . last == null ) return x ; Node itr = this . last . next ; while ( itr . next != this . last . next ) { x ++ ; itr = itr . next ; } return ( x + 1 ) ; } public Node split ( int k ) { Node pass = new Node ( ) ; if ( this . last == null ) return this . last ; Node newLast , itr = this . last ; for ( int i = 0 ; i < k ; i ++ ) { itr = itr . next ; } newLast = itr ; pass . next = itr . next ; newLast . next = this . last . next ; this . last . next = pass . next ; return newLast ; } public static void Main ( String [ ] args ) { CircularLinkedList clist = new CircularLinkedList ( ) ; clist . last = null ; clist . addToEmpty ( 12 ) ; clist . addBegin ( 10 ) ; clist . addBegin ( 8 ) ; clist . addBegin ( 6 ) ; clist . addBegin ( 4 ) ; clist . addBegin ( 2 ) ; Console . WriteLine ( " Original ▁ list : " ) ; clist . traverse ( ) ; int k = 4 ; CircularLinkedList clist2 = new CircularLinkedList ( ) ; clist2 . last = clist . split ( k ) ; Console . WriteLine ( " The ▁ new ▁ lists ▁ are : " ) ; clist2 . traverse ( ) ; clist . traverse ( ) ; } }

Accumulator variables: i, x
Iterator variables: i
Class/struct names: CircularLinkedList, Node
C# program:
using System ; using System . Collections . Generic ; class GFG { public class Node { public int data ; public Node left ; public Node right ; public Node ( int x ) { data = x ; left = right = null ; } } ; static void inorder ( Node root , List < int > v ) { if ( root == null ) return ; inorder ( root . left , v ) ; v . Add ( root . data ) ; inorder ( root . right , v ) ; } static Node bTreeToCList ( Node root ) { if ( root == null ) return null ; List < int > v = new List < int > ( ) ; inorder ( root , v ) ; Node head_ref = new Node ( v [ 0 ] ) ; Node curr = head_ref ; for ( int i = 1 ; i < v . Count ; i ++ ) { Node temp = curr ; curr . right = new Node ( v [ i ] ) ; curr = curr . right ; curr . left = temp ; } curr . right = head_ref ; head_ref . left = curr ; return head_ref ; } static void displayCList ( Node head ) { Console . WriteLine ( " Circular ▁ Doubly ▁ " + " Linked ▁ List ▁ is ▁ : " ) ; Node itr = head ; do { Console . Write ( itr . data + " ▁ " ) ; itr = itr . right ; } while ( head != itr ) ; Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { Node root = new Node ( 10 ) ; root . left = new Node ( 12 ) ; root . right = new Node ( 15 ) ; root . left . left = new Node ( 25 ) ; root . left . right = new Node ( 30 ) ; root . right . left = new Node ( 36 ) ; Node head = bTreeToCList ( root ) ; displayCList ( head ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static void printMinMax ( Node head ) { if ( head == null ) { return ; } Node current ; current = head ; int min = int . MaxValue , max = int . MinValue ; while ( current . next != head ) { if ( current . data < min ) { min = current . data ; } if ( current . data > max ) { max = current . data ; } current = current . next ; } Console . WriteLine ( " Minimum = " ▁ + ▁ min ▁ + ▁ " , Maximum = " } static Node ( Node head , int data ) { current = head ; newNode = new Node ( ) ; if ( newNode == null ) { Console . Write ( " STRNEWLINE Memory ▁ Error STRNEWLINE " ) ; return null ; } newNode . data = data ; if ( head == null ) { newNode . next = newNode ; = newNode ; return ; } else { while ( current . next != head ) { current = current . next ; } newNode . next = head ; . next = newNode ; } return ; } static void ( Node head ) { current = head ; if ( head == null ) { Console . Write ( " STRNEWLINE Display ▁ List ▁ is ▁ empty STRNEWLINE " ) ; return ; } else { do { Console . Write ( " { 0 } ▁ " , current . data ) ; = current . next ; } while ( current != head ) ; } } public static void ( ) { Head = null ; Head = insertNode ( Head , 99 ) ; Head = insertNode ( Head , 11 ) ; Head = insertNode ( Head , 22 ) ; Head = insertNode ( Head , 33 ) ; Head = insertNode ( Head , 44 ) ; Head = insertNode ( Head , 55 ) ; Head = insertNode ( Head , 66 ) ; Console . WriteLine ( " Initial ▁ List : ▁ " ) ; displayList ( Head ) ; printMinMax ( Head ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static Node push ( Node head_ref , int data ) { Node ptr1 = new Node ( ) ; Node temp = head_ref ; ptr1 . data = data ; ptr1 . next = head_ref ; if ( head_ref != null ) { while ( temp . next != head_ref ) temp = temp . next ; temp . next = ptr1 ; return head_ref ; } else ptr1 . next = ptr1 ; head_ref = ptr1 ; return head_ref ; } static Node deleteNode ( Node head_ref , Node del ) { Node temp = head_ref ; if ( head_ref == del ) head_ref = del . next ; while ( temp . next != del ) { temp = temp . next ; } temp . next = del . next ; return head_ref ; } static Node deleteEvenNodes ( Node head ) { Node ptr = head ; Node next ; do { if ( ptr . data % 2 == 0 ) deleteNode ( head , ptr ) ; next = ptr . next ; ptr = next ; } while ( ptr != head ) ; return head ; } static void printList ( Node head ) { Node temp = head ; if ( head != null ) { do { Console . Write ( " { 0 } ▁ " , temp . data ) ; temp = temp . next ; } while ( temp != head ) ; } } public static void Main ( String [ ] args ) { Node head = null ; head = push ( head , 61 ) ; head = push ( head , 12 ) ; head = push ( head , 56 ) ; head = push ( head , 2 ) ; head = push ( head , 11 ) ; head = push ( head , 57 ) ; Console . WriteLine ( " STRNEWLINE List ▁ after ▁ deletion ▁ : ▁ " ) ; head = deleteEvenNodes ( head ) ; printList ( head ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; class GFG { class Node { public int data ; public Node next ; } ; static Node push ( Node head_ref , int data ) { Node ptr1 = new Node ( ) ; Node temp = head_ref ; ptr1 . data = data ; ptr1 . next = head_ref ; if ( head_ref != null ) { while ( temp . next != head_ref ) temp = temp . next ; temp . next = ptr1 ; } else ptr1 . next = ptr1 ; head_ref = ptr1 ; return head_ref ; } static int sumOfList ( Node head ) { Node temp = head ; int sum = 0 ; if ( head != null ) { do { temp = temp . next ; sum += temp . data ; } while ( temp != head ) ; } return sum ; } public static void Main ( ) { Node head = null ; head = push ( head , 12 ) ; head = push ( head , 56 ) ; head = push ( head , 2 ) ; head = push ( head , 11 ) ; Console . WriteLine ( " Sum ▁ of ▁ Circular ▁ linked " + " ▁ list ▁ is ▁ = ▁ " + sumOfList ( head ) ) ; } }

Accumulator variables: sum
Class/struct names: GFG, Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; public Node ( int x ) { data = x ; next = null ; } } ; static void printList ( Node head ) { if ( head == null ) return ; Node temp = head ; do { Console . Write ( temp . data + " - > " ) ; temp = temp . next ; } while ( temp != head ) ; Console . WriteLine ( head . data ) ; } static Node deleteK ( Node head_ref , int k ) { Node head = head_ref ; if ( head == null ) return null ; Node curr = head , prev = null ; while ( true ) { if ( curr . next == head && curr == head ) break ; printList ( head ) ; for ( int i = 0 ; i < k ; i ++ ) { prev = curr ; curr = curr . next ; } if ( curr == head ) { prev = head ; while ( prev . next != head ) prev = prev . next ; head = curr . next ; prev . next = head ; head_ref = head ; } else if ( curr . next == head ) { prev . next = head ; } else { prev . next = curr . next ; } } return head ; } static Node insertNode ( Node head_ref , int x ) { Node head = head_ref ; Node temp = new Node ( x ) ; if ( head == null ) { temp . next = temp ; head_ref = temp ; return head_ref ; } else { Node temp1 = head ; while ( temp1 . next != head ) temp1 = temp1 . next ; temp1 . next = temp ; temp . next = head ; } return head ; } public static void Main ( String [ ] args ) { Node head = null ; head = insertNode ( head , 1 ) ; head = insertNode ( head , 2 ) ; head = insertNode ( head , 3 ) ; head = insertNode ( head , 4 ) ; head = insertNode ( head , 5 ) ; head = insertNode ( head , 6 ) ; head = insertNode ( head , 7 ) ; head = insertNode ( head , 8 ) ; head = insertNode ( head , 9 ) ; int k = 4 ; head = deleteK ( head , k ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, Node
C# program:
using System ; class GFG { public class node { public int data ; public node next ; public node prev ; } ; static node getNode ( ) { return new node ( ) ; } static int displayList ( node temp ) { node t = temp ; if ( temp == null ) return 0 ; else { Console . WriteLine ( " The ▁ list ▁ is : ▁ " ) ; while ( temp . next != t ) { Console . Write ( temp . data + " ▁ " ) ; temp = temp . next ; } Console . WriteLine ( temp . data ) ; return 1 ; } } static int countList ( node start ) { node temp = start ; int count = 0 ; while ( temp . next != start ) { temp = temp . next ; count ++ ; } count ++ ; return count ; } static node insertAtLocation ( node start , int data , int loc ) { node temp , newNode ; int i , count ; newNode = getNode ( ) ; temp = start ; count = countList ( start ) ; if ( temp == null count < loc ) return start ; else { newNode . data = data ; for ( i = 1 ; i < loc - 1 ; i ++ ) { temp = temp . next ; } newNode . next = temp . next ; ( temp . next ) . prev = newNode ; temp . next = newNode ; newNode . prev = temp ; return start ; } } static node createList ( int [ ] arr , int n , node start ) { node newNode , temp ; int i ; for ( i = 0 ; i < n ; i ++ ) { newNode = getNode ( ) ; newNode . data = arr [ i ] ; if ( i == 0 ) { start = newNode ; newNode . prev = start ; newNode . next = start ; } else { temp = ( start ) . prev ; temp . next = newNode ; newNode . next = start ; newNode . prev = temp ; temp = start ; temp . prev = newNode ; } } return start ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 , 6 } ; int n = arr . Length ; node start = null ; start = createList ( arr , n , start ) ; displayList ( start ) ; start = insertAtLocation ( start , 8 , 3 ) ; displayList ( start ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG, node
C# program:
using System ; class GFG { public class node { public int data ; public node next ; public node prev ; } ; static node getNode ( ) { return new node ( ) ; } static int displayList ( node temp ) { node t = temp ; if ( temp == null ) return 0 ; else { Console . Write ( " The ▁ list ▁ is : ▁ " ) ; while ( temp . next != t ) { Console . Write ( temp . data + " ▁ " ) ; temp = temp . next ; } Console . Write ( temp . data ) ; return 1 ; } } static node createList ( int [ ] arr , int n , node start ) { node newNode , temp ; int i ; for ( i = 0 ; i < n ; i ++ ) { newNode = getNode ( ) ; newNode . data = arr [ i ] ; if ( i == 0 ) { start = newNode ; newNode . prev = start ; newNode . next = start ; } else { temp = ( start ) . prev ; temp . next = newNode ; newNode . next = start ; newNode . prev = temp ; temp = start ; temp . prev = newNode ; } } return start ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 } ; int n = arr . Length ; node start = null ; start = createList ( arr , n , start ) ; displayList ( start ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, node