dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; public class GfG { public class Node { public int data ; public Node left , right ; } public static void printOddNodes ( Node root , bool isOdd ) { if ( root == null ) { return ; } if ( isOdd == true ) { Console . Write ( root . data + " ▁ " ) ; } printOddNodes ( root . left , ! isOdd ) ; printOddNodes ( root . right , ! isOdd ) ; } public static Node newNode ( int data ) { Node node = new Node ( ) ; node . data = data ; node . left = null ; node . right = null ; return ( node ) ; } public static void Main ( string [ ] args ) { Node root = newNode ( 1 ) ; root . left = newNode ( 2 ) ; root . right = newNode ( 3 ) ; root . left . left = newNode ( 4 ) ; root . left . right = newNode ( 5 ) ; printOddNodes ( root , true ) ; } }

Class/struct names: GfG, Node
C# program:
using System ; class GFG { static int maxSum ( int [ ] arr , int n ) { int res = int . MinValue ; for ( int i = 0 ; i < n ; i ++ ) { int curr_sum = 0 ; for ( int j = 0 ; j < n ; j ++ ) { int index = ( i + j ) % n ; curr_sum += j * arr [ index ] ; } res = Math . Max ( res , curr_sum ) ; } return res ; } public static void Main ( ) { int [ ] arr = { 8 , 3 , 1 , 2 } ; int n = arr . Length ; Console . WriteLine ( maxSum ( arr , n ) ) ; } }

Index/key variables: index
Accumulator variables: curr_sum, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxSum ( int [ ] arr , int n ) { int cum_sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) cum_sum += arr [ i ] ; int curr_val = 0 ; for ( int i = 0 ; i < n ; i ++ ) curr_val += i * arr [ i ] ; int res = curr_val ; for ( int i = 1 ; i < n ; i ++ ) { int next_val = curr_val - ( cum_sum - arr [ i - 1 ] ) + arr [ i - 1 ] * ( n - 1 ) ; curr_val = next_val ; res = Math . Max ( res , next_val ) ; } return res ; } public static void Main ( ) { int [ ] arr = { 8 , 3 , 1 , 2 } ; int n = arr . Length ; Console . Write ( maxSum ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: cum_sum, curr_val, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int solve ( int [ ] arr , int n ) { int k = arr . Length ; int [ ] mp = new int [ n + 2 ] ; for ( int i = 0 ; i <= n ; i ++ ) { mp [ i ] = 0 ; } for ( int i = 0 ; i < k ; i ++ ) { mp [ arr [ i ] ] = 1 ; } int leftSegment = arr [ 0 ] - 1 ; for ( int i = 1 ; i < k ; i ++ ) { leftSegment = Math . Max ( leftSegment , arr [ i ] - arr [ i - 1 ] - 1 ) ; } int rightSegment = n - arr [ k - 1 ] ; int maxSegment = Math . Max ( leftSegment , rightSegment ) ; int tim ; if ( ( maxSegment & 1 ) == 1 ) tim = ( maxSegment / 2 ) + 1 ; else tim = maxSegment / 2 ; return tim ; } public static void Main ( ) { int N = 5 ; int [ ] arr = { 1 , 4 } ; Console . Write ( solve ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class LinearSearch { static int countRotations ( int [ ] arr , int n ) { int min = arr [ 0 ] , min_index = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( min > arr [ i ] ) { min = arr [ i ] ; min_index = i ; } } return min_index ; } public static void Main ( ) { int [ ] arr = { 15 , 18 , 2 , 3 , 6 , 12 } ; int n = arr . Length ; Console . WriteLine ( countRotations ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: LinearSearch
C# program:
using System ; class BinarySearch { static int countRotations ( int [ ] arr , int low , int high ) { if ( high < low ) return 0 ; if ( high == low ) return low ; int mid = low + ( high - low ) / 2 ; if ( mid < high && arr [ mid + 1 ] < arr [ mid ] ) return ( mid + 1 ) ; if ( mid > low && arr [ mid ] < arr [ mid - 1 ] ) return mid ; if ( arr [ high ] > arr [ mid ] ) return countRotations ( arr , low , mid - 1 ) ; return countRotations ( arr , mid + 1 , high ) ; } public static void Main ( ) { int [ ] arr = { 15 , 18 , 2 , 3 , 6 , 12 } ; int n = arr . Length ; Console . WriteLine ( countRotations ( arr , 0 , n - 1 ) ) ; } }

Index/key variables: high, mid
Class/struct names: BinarySearch
C# program:
using System ; class LeftRotate { static void preprocess ( int [ ] arr , int n , int [ ] temp ) { for ( int i = 0 ; i < n ; i ++ ) temp [ i ] = temp [ i + n ] = arr [ i ] ; } static void leftRotate ( int [ ] arr , int n , int k , int [ ] temp ) { int start = k % n ; for ( int i = start ; i < start + n ; i ++ ) Console . Write ( temp [ i ] + " ▁ " ) ; Console . WriteLine ( ) ; } public static void Main ( ) { int [ ] arr = { 1 , 3 , 5 , 7 , 9 } ; int n = arr . Length ; int [ ] temp = new int [ 2 * n ] ; preprocess ( arr , n , temp ) ; int k = 2 ; leftRotate ( arr , n , k , temp ) ; k = 3 ; leftRotate ( arr , n , k , temp ) ; k = 4 ; leftRotate ( arr , n , k , temp ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: LeftRotate
C# program:
using System ; class GFG { public static void Desired_Array ( int [ ] v ) { int n = v . Length ; Array . Sort ( v ) ; int i = n - 1 ; while ( i > 0 ) { int p = v [ n - 1 ] ; for ( int j = n - 1 ; j >= i ; j -- ) { v [ j ] = v [ j - 1 ] ; } v [ i ] = p ; i -- ; } for ( int x = 0 ; x < v . Length ; x ++ ) { Console . Write ( v [ x ] + " ▁ " ) ; } Console . WriteLine ( ) ; } static public void Main ( ) { int [ ] v = { 1 , 2 , 3 , 4 , 5 } ; Desired_Array ( v ) ; int [ ] v1 = { 1 , 12 , 2 , 10 , 4 , 16 , 6 } ; Desired_Array ( v1 ) ; } }

Index/key variables: i, j, x
Accumulator variables: i, j, x
Iterator variables: j, x
Class/struct names: GFG
C# program:
using System ; class GFG { static void leftRotate ( int [ ] arr , int n , int k ) { for ( int i = k ; i < k + n ; i ++ ) Console . Write ( arr [ i % n ] + " ▁ " ) ; } static public void Main ( ) { int [ ] arr = { 1 , 3 , 5 , 7 , 9 } ; int n = arr . Length ; int k = 2 ; leftRotate ( arr , n , k ) ; Console . WriteLine ( ) ; k = 3 ; leftRotate ( arr , n , k ) ; Console . WriteLine ( ) ; k = 4 ; leftRotate ( arr , n , k ) ; Console . WriteLine ( ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int [ ] sortArrays ( int [ ] arr ) { int length = arr . Length ; for ( int j = 0 ; j < length - 1 ; j ++ ) { if ( arr [ j ] > arr [ j + 1 ] ) { int temp = arr [ j ] ; arr [ j ] = arr [ j + 1 ] ; arr [ j + 1 ] = temp ; j = - 1 ; } } return arr ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 99 , 9 , 8 , 7 , 6 , 0 , 5 , 4 , 3 } ; Console . WriteLine ( " Original ▁ array : ▁ " + String . Join ( " , ▁ " , arr ) ) ; arr = sortArrays ( arr ) ; Console . WriteLine ( " Sorted ▁ array : ▁ " + String . Join ( " , ▁ " , arr ) ) ; } }

Index/key variables: j
Accumulator variables: j
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; class GFG { public static char [ ] sortArrays ( char [ ] arr ) { int length = arr . Length ; for ( int j = 0 ; j < arr . Length - 1 ; j ++ ) { int d1 = arr [ j ] ; int d2 = arr [ j + 1 ] ; if ( d1 > d2 ) { char temp = arr [ j ] ; arr [ j ] = arr [ j + 1 ] ; arr [ j + 1 ] = temp ; j = - 1 ; } } return arr ; } public static void Main ( String [ ] args ) { String geeks = " GEEKSFORGEEKS " ; char [ ] arr = geeks . ToCharArray ( ) ; Console . WriteLine ( " Original ▁ array : ▁ [ " + String . Join ( " , ▁ " , arr ) + " ] " ) ; arr = sortArrays ( arr ) ; Console . WriteLine ( " Sorted ▁ array : ▁ [ " + String . Join ( " , ▁ " , arr ) + " ] " ) ; } }

Index/key variables: j
Accumulator variables: j
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; using System . Collections ; using System . Collections . Generic ; class Node { public int data ; public Node left , right ; public Node ( int item ) { data = item ; left = right = null ; } } class GFG { public static int findLevel ( Node root , int data ) { if ( data < root . data ) return - 1 ; if ( data == root . data ) return 0 ; int cur_level = 0 ; while ( true ) { cur_level ++ ; root = root . left ; if ( root . data == data ) return - 2 ; if ( root . data < data && ( root . left == null root . left . data > data ) ) { break ; } } return cur_level ; } public static int traversePath ( Node root , List < int > path ) { for ( int i = 0 ; i < path . Count ; i ++ ) { int direction = path [ i ] ; if ( direction == 0 ) { if ( root . left == null ) return - 1 ; root = root . left ; } else { if ( root . right == null ) return - 1 ; root = root . right ; } } return root . data ; } static List < int > generateGray ( int n , int x ) { List < int > gray = new List < int > ( ) ; int i = 0 ; while ( x > 0 ) { gray . Add ( x % 2 ) ; x = x / 2 ; i ++ ; } gray . Reverse ( ) ; for ( int j = 0 ; j < n - i ; j ++ ) gray . Insert ( 0 , 0 ) ; return gray ; } public static bool binarySearch ( Node root , int start , int end , int data , int level ) { if ( end >= start ) { int mid = ( start + end ) / 2 ; List < int > encoding = generateGray ( level , mid ) ; int element_found = traversePath ( root , encoding ) ; if ( element_found == - 1 ) return binarySearch ( root , start , mid - 1 , data , level ) ; if ( element_found == data ) return true ; if ( element_found < data ) return binarySearch ( root , mid + 1 , end , data , level ) ; else return binarySearch ( root , start , mid - 1 , data , level ) ; } return false ; } public static bool findKey ( Node root , int data ) { int level = findLevel ( root , data ) ; if ( level == - 1 ) return false ; if ( level == - 2 ) return true ; return binarySearch ( root , 0 , ( int ) Math . Pow ( 2 , level ) - 1 , data , level ) ; } static void Main ( ) { Node root = new Node ( 5 ) ; root . left = new Node ( 8 ) ; root . right = new Node ( 10 ) ; root . left . left = new Node ( 13 ) ; root . left . right = new Node ( 23 ) ; root . right . left = new Node ( 25 ) ; root . right . right = new Node ( 30 ) ; root . left . left . left = new Node ( 32 ) ; root . left . left . right = new Node ( 40 ) ; root . left . right . left = new Node ( 50 ) ; int [ ] arr = { 5 , 8 , 9 } ; int n = arr . Length ; for ( int i = 0 ; i < n ; i ++ ) { if ( findKey ( root , arr [ i ] ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } } }

Index/key variables: i
Accumulator variables: cur_level, i, j
Iterator variables: i, j
Class/struct names: GFG, Node
C# program:
using System ; class GFG { static int MAX = 1000 ; static void ToSpiral ( int m , int n , int [ ] Sorted , int [ , ] a ) { int index = 0 ; int k = 0 , l = 0 ; while ( k < m && l < n ) { for ( int i = l ; i < n ; ++ i ) { a [ k , i ] = Sorted [ index ] ; index ++ ; } k ++ ; for ( int i = k ; i < m ; ++ i ) { a [ i , n - 1 ] = Sorted [ index ] ; index ++ ; } n -- ; if ( k < m ) { for ( int i = n - 1 ; i >= l ; -- i ) { a [ m - 1 , i ] = Sorted [ index ] ; index ++ ; } m -- ; } if ( l < n ) { for ( int i = m - 1 ; i >= k ; -- i ) { a [ i , l ] = Sorted [ index ] ; index ++ ; } l ++ ; } } } public static int [ ] convert2Dto1D ( int [ , ] y , int m , int n ) { int index = 0 ; int [ ] x = new int [ m * n ] ; for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { x [ index ] = y [ i , j ] ; index ++ ; } } return x ; } public static void PrintMatrix ( int [ , ] a , int m , int n ) { for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { Console . Write ( a [ i , j ] + " ▁ " ) ; } Console . WriteLine ( ) ; } } public static int [ ] SortArray ( int [ ] x ) { Array . Sort ( x ) ; return x ; } public static void convertMatrixToSortedSpiral ( int [ , ] y , int m , int n ) { int [ , ] a = new int [ MAX , MAX ] ; int [ ] x = new int [ m * n ] ; x = convert2Dto1D ( y , m , n ) ; x = SortArray ( x ) ; ToSpiral ( m , n , x , a ) ; PrintMatrix ( a , m , n ) ; } public static void Main ( String [ ] args ) { int m = 4 , n = 3 ; int [ , ] y = { { 2 , 5 , 12 } , { 22 , 45 , 55 } , { 1 , 6 , 8 } , { 13 , 56 , 10 } } ; convertMatrixToSortedSpiral ( y , m , n ) ; } }

Index/key variables: index
Accumulator variables: i, index, j, k, l, m, n
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void reverseArray ( int [ ] arr , int start , int end ) { while ( start < end ) { int temp = arr [ start ] ; arr [ start ] = arr [ end ] ; arr [ end ] = temp ; start ++ ; end -- ; } } static void rightRotate ( int [ ] arr , int d , int n ) { reverseArray ( arr , 0 , n - 1 ) ; reverseArray ( arr , 0 , d - 1 ) ; reverseArray ( arr , d , n - 1 ) ; } static void printArray ( int [ ] arr , int size ) { for ( int i = 0 ; i < size ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 } ; int n = arr . Length ; int k = 3 ; rightRotate ( arr , k , n ) ; printArray ( arr , n ) ; } }

Index/key variables: end, i, start
Accumulator variables: end, i, start
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GfG { public class Node { public int data ; public Node left , right ; } static void printOddNodes ( Node root ) { if ( root == null ) return ; Queue < Node > q = new Queue < Node > ( ) ; q . Enqueue ( root ) ; bool isOdd = true ; while ( true ) { int nodeCount = q . Count ; if ( nodeCount == 0 ) break ; while ( nodeCount > 0 ) { Node node = q . Peek ( ) ; if ( isOdd == true ) Console . Write ( node . data + " ▁ " ) ; q . Dequeue ( ) ; if ( node . left != null ) q . Enqueue ( node . left ) ; if ( node . right != null ) q . Enqueue ( node . right ) ; nodeCount -- ; } isOdd = ! isOdd ; } } static Node newNode ( int data ) { Node node = new Node ( ) ; node . data = data ; node . left = null ; node . right = null ; return ( node ) ; } public static void Main ( String [ ] args ) { Node root = newNode ( 1 ) ; root . left = newNode ( 2 ) ; root . right = newNode ( 3 ) ; root . left . left = newNode ( 4 ) ; root . left . right = newNode ( 5 ) ; printOddNodes ( root ) ; } }

Accumulator variables: nodeCount
Boolean variables: isOdd
Class/struct names: GfG, Node
C# program:
using System ; class GFG { static int maxHamming ( int [ ] arr , int n ) { int [ ] brr = new int [ 2 * n + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) brr [ i ] = arr [ i ] ; for ( int i = 0 ; i < n ; i ++ ) brr [ n + i ] = arr [ i ] ; int maxHam = 0 ; for ( int i = 1 ; i < n ; i ++ ) { int currHam = 0 ; for ( int j = i , k = 0 ; j < ( i + n ) ; j ++ , k ++ ) if ( brr [ j ] != arr [ k ] ) currHam ++ ; if ( currHam == n ) return n ; maxHam = Math . Max ( maxHam , currHam ) ; } return maxHam ; } public static void Main ( ) { int [ ] arr = { 2 , 4 , 6 , 8 } ; int n = arr . Length ; Console . Write ( maxHamming ( arr , n ) ) ; } }

Index/key variables: i, j, k
Accumulator variables: currHam, i, j, k
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void leftRotate ( int [ ] arr , int n , int k ) { int mod = k % n ; for ( int i = 0 ; i < n ; ++ i ) Console . Write ( arr [ ( i + mod ) % n ] + " ▁ " ) ; Console . WriteLine ( ) ; } static public void Main ( ) { int [ ] arr = { 1 , 3 , 5 , 7 , 9 } ; int n = arr . Length ; int k = 2 ; leftRotate ( arr , n , k ) ; k = 3 ; leftRotate ( arr , n , k ) ; k = 4 ; leftRotate ( arr , n , k ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findElement ( int [ ] arr , int [ , ] ranges , int rotations , int index ) { for ( int i = rotations - 1 ; i >= 0 ; i -- ) { int left = ranges [ i , 0 ] ; int right = ranges [ i , 1 ] ; if ( left <= index && right >= index ) { if ( index == left ) index = right ; else index -- ; } } return arr [ index ] ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 } ; int rotations = 2 ; int [ , ] ranges = { { 0 , 2 } , { 0 , 3 } } ; int index = 1 ; Console . Write ( findElement ( arr , ranges , rotations , index ) ) ; } }

Index/key variables: index
Accumulator variables: i, index
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static string sort ( string s ) { char [ ] c = new char [ s . Length + 1 ] ; c = s . ToCharArray ( ) ; Array . Sort ( c ) ; int al_c = 0 , nu_c = 0 ; while ( c [ al_c ] < 97 ) al_c ++ ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( s [ i ] < 97 ) s = s . Substring ( 0 , i ) + c [ nu_c ++ ] + s . Substring ( i + 1 ) ; else s = s . Substring ( 0 , i ) + c [ al_c ++ ] + s . Substring ( i + 1 ) ; } return s ; } public static void Main ( ) { string s = " d4c3b2a1" ; Console . WriteLine ( sort ( s ) ) ; } }

Index/key variables: al_c, i
Accumulator variables: al_c, i, nu_c
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void splitArr ( int [ ] arr , int n , int k ) { for ( int i = 0 ; i < k ; i ++ ) { int x = arr [ 0 ] ; for ( int j = 0 ; j < n - 1 ; ++ j ) arr [ j ] = arr [ j + 1 ] ; arr [ n - 1 ] = x ; } } public static void Main ( ) { int [ ] arr = { 12 , 10 , 5 , 6 , 52 , 36 } ; int n = arr . Length ; int position = 2 ; splitArr ( arr , 6 , position ) ; for ( int i = 0 ; i < n ; ++ i ) Console . Write ( arr [ i ] + " ▁ " ) ; } }

Index/key variables: i, j
Accumulator variables: i
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static void SplitAndAdd ( int [ ] A , int length , int rotation ) { int [ ] tmp = new int [ length * 2 ] ; Array . Copy ( A , 0 , tmp , 0 , length ) ; Array . Copy ( A , 0 , tmp , length , length ) ; for ( int i = rotation ; i < rotation + length ; i ++ ) { A [ i - rotation ] = tmp [ i ] ; } } public static void Main ( string [ ] args ) { int [ ] arr = new int [ ] { 12 , 10 , 5 , 6 , 52 , 36 } ; int n = arr . Length ; int position = 2 ; SplitAndAdd ( arr , n , position ) ; for ( int i = 0 ; i < n ; ++ i ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int [ ] swap ( int [ ] arr , int i , int j ) { int temp = arr [ i ] ; arr [ i ] = arr [ j ] ; arr [ j ] = temp ; return arr ; } static void sort_shell_metzner ( int [ ] arr , int n ) { int i , j , k , l , m , temp ; m = n ; while ( m > 0 ) { m /= 2 ; k = n - m ; j = 0 ; do { i = j ; do { l = i + m ; if ( l < n && arr [ i ] > arr [ l ] ) { swap ( arr , i , l ) ; i -= m ; } else { break ; } } while ( i >= 0 ) ; j ++ ; } while ( j <= k ) ; } } static void printArray ( int [ ] arr , int n ) { for ( int i = 0 ; i < n ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 0 , - 2 , 8 , 5 , 1 } ; int n = arr . Length ; sort_shell_metzner ( arr , n ) ; printArray ( arr , n ) ; } }

Index/key variables: i, j, l
Accumulator variables: i, j, m
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void fixArray ( int [ ] ar , int n ) { int i , j , temp ; for ( i = 0 ; i < n ; i ++ ) { for ( j = 0 ; j < n ; j ++ ) { if ( ar [ j ] == i ) { temp = ar [ j ] ; ar [ j ] = ar [ i ] ; ar [ i ] = temp ; break ; } } } for ( i = 0 ; i < n ; i ++ ) { if ( ar [ i ] != i ) { ar [ i ] = - 1 ; } } Console . WriteLine ( " Array ▁ after ▁ Rearranging " ) ; for ( i = 0 ; i < n ; i ++ ) { Console . Write ( ar [ i ] + " ▁ " ) ; } } static void Main ( ) { int [ ] ar = { - 1 , - 1 , 6 , 1 , 9 , 3 , 2 , - 1 , 4 , - 1 } ; int n = ar . Length ; fixArray ( ar , n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class Node { public int data ; public Node left , right ; public Node ( int data ) { left = right = null ; this . data = data ; } } ; public class FullNodes { static void findFullNode ( Node root ) { if ( root != null ) { findFullNode ( root . left ) ; if ( root . left != null && root . right != null ) Console . Write ( root . data + " ▁ " ) ; findFullNode ( root . right ) ; } } public static void Main ( String [ ] args ) { Node root = new Node ( 1 ) ; root . left = new Node ( 2 ) ; root . right = new Node ( 3 ) ; root . left . left = new Node ( 4 ) ; root . right . left = new Node ( 5 ) ; root . right . right = new Node ( 6 ) ; root . right . left . right = new Node ( 7 ) ; root . right . right . right = new Node ( 8 ) ; root . right . left . right . left = new Node ( 9 ) ; findFullNode ( root ) ; } }

Class/struct names: FullNodes, Node
C# program:
using System ; using System . Collections . Generic ; class GFG { static void findElementsAfterDel ( int [ ] arr , int m , int [ ] del , int n , int k ) { Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { if ( mp . ContainsKey ( del [ i ] ) ) { mp [ del [ i ] ] ++ ; } else { mp . Add ( del [ i ] , 1 ) ; } } List < int > heap = new List < int > ( ) ; for ( int i = 0 ; i < m ; ++ i ) { if ( mp . ContainsKey ( arr [ i ] ) ) { mp [ arr [ i ] ] -- ; if ( mp [ arr [ i ] ] == 0 ) { mp . Remove ( arr [ i ] ) ; } } else { heap . Add ( arr [ i ] ) ; } } heap . Sort ( ) ; heap . Reverse ( ) ; for ( int i = 0 ; i < k ; ++ i ) { Console . Write ( heap [ i ] + " ▁ " ) ; } } static public void Main ( ) { int [ ] array = { 5 , 12 , 33 , 4 , 56 , 12 , 20 } ; int m = array . Length ; int [ ] del = { 12 , 56 , 5 } ; int n = del . Length ; int k = 3 ; findElementsAfterDel ( array , m , del , n , k ) ; } }

Index/key variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; using System . Collections ; class GFG { public static void kThLexString ( string st , int k , int n ) { HashSet < string > z = new HashSet < string > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { string pp = " " ; for ( int j = i ; j < i + k ; j ++ ) { if ( j >= n ) break ; pp += st [ j ] ; z . Add ( pp ) ; } } ArrayList fin = new ArrayList ( ) ; foreach ( string s in z ) { fin . Add ( s ) ; } fin . Sort ( ) ; Console . Write ( fin [ k - 1 ] ) ; } public static void Main ( string [ ] args ) { string s = " geeksforgeeks " ; int k = 5 ; int n = s . Length ; kThLexString ( s , k , n ) ; } }

Index/key variables: j
Accumulator variables: i, j, pp
Iterator variables: i, j, s
Class/struct names: GFG
C# program:
using System ; public class GfG { public static void rearrangeArr ( int [ ] arr , int n ) { int evenPos = n / 2 ; int oddPos = n - evenPos ; int [ ] tempArr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) tempArr [ i ] = arr [ i ] ; Array . Sort ( tempArr ) ; int j = oddPos - 1 ; for ( int i = 0 ; i < n ; i += 2 ) { arr [ i ] = tempArr [ j ] ; j -- ; } j = oddPos ; for ( int i = 1 ; i < n ; i += 2 ) { arr [ i ] = tempArr [ j ] ; j ++ ; } for ( int i = 0 ; i < n ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; } public static void Main ( ) { int [ ] arr = new int [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 } ; int size = 7 ; rearrangeArr ( arr , size ) ; } }

Index/key variables: i, j, n
Accumulator variables: i, j
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; public class Node { public int data ; public Node prev , next ; public Node ( int val ) { data = val ; prev = null ; next = null ; } } class GFG { static int countTriplets ( Node head , int x ) { Node ptr1 , ptr2 , ptr3 ; int count = 0 ; for ( ptr1 = head ; ptr1 != null ; ptr1 = ptr1 . next ) for ( ptr2 = ptr1 . next ; ptr2 != null ; ptr2 = ptr2 . next ) for ( ptr3 = ptr2 . next ; ptr3 != null ; ptr3 = ptr3 . next ) if ( ( ptr1 . data * ptr2 . data * ptr3 . data ) == x ) count ++ ; return count ; } static Node insert ( Node head , int val ) { Node temp = new Node ( val ) ; if ( head == null ) head = temp ; else { temp . next = head ; head . prev = temp ; head = temp ; } return head ; } public static void Main ( String [ ] args ) { Node head = null ; head = insert ( head , 9 ) ; head = insert ( head , 8 ) ; head = insert ( head , 6 ) ; head = insert ( head , 5 ) ; head = insert ( head , 4 ) ; head = insert ( head , 2 ) ; head = insert ( head , 1 ) ; int x = 8 ; Console . WriteLine ( " count ▁ = ▁ " + countTriplets ( head , x ) ) ; } }

Accumulator variables: count
Iterator variables: ptr1, ptr2, ptr3
Class/struct names: GFG, Node