dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; public class Node { public int data ; public Node left , right ; public Node ( int item ) { data = item ; left = right = null ; } } class GFG { public Node root ; public virtual void printSpecificLevelOrder ( Node node ) { if ( node == null ) { return ; } Console . Write ( node . data ) ; if ( node . left != null ) { Console . Write ( " ▁ " + node . left . data + " ▁ " + node . right . data ) ; } if ( node . left . left == null ) { return ; } LinkedList < Node > q = new LinkedList < Node > ( ) ; q . AddLast ( node . left ) ; q . AddLast ( node . right ) ; Node first = null , second = null ; while ( q . Count > 0 ) { first = q . First . Value ; q . RemoveFirst ( ) ; second = q . First . Value ; q . RemoveFirst ( ) ; Console . Write ( " ▁ " + first . left . data + " ▁ " + second . right . data ) ; Console . Write ( " ▁ " + first . right . data + " ▁ " + second . left . data ) ; if ( first . left . left != null ) { q . AddLast ( first . left ) ; q . AddLast ( second . right ) ; q . AddLast ( first . right ) ; q . AddLast ( second . left ) ; } } } public static void Main ( string [ ] args ) { GFG tree = new GFG ( ) ; tree . root = new Node ( 1 ) ; tree . root . left = new Node ( 2 ) ; tree . root . right = new Node ( 3 ) ; tree . root . left . left = new Node ( 4 ) ; tree . root . left . right = new Node ( 5 ) ; tree . root . right . left = new Node ( 6 ) ; tree . root . right . right = new Node ( 7 ) ; tree . root . left . left . left = new Node ( 8 ) ; tree . root . left . left . right = new Node ( 9 ) ; tree . root . left . right . left = new Node ( 10 ) ; tree . root . left . right . right = new Node ( 11 ) ; tree . root . right . left . left = new Node ( 12 ) ; tree . root . right . left . right = new Node ( 13 ) ; tree . root . right . right . left = new Node ( 14 ) ; tree . root . right . right . right = new Node ( 15 ) ; tree . root . left . left . left . left = new Node ( 16 ) ; tree . root . left . left . left . right = new Node ( 17 ) ; tree . root . left . left . right . left = new Node ( 18 ) ; tree . root . left . left . right . right = new Node ( 19 ) ; tree . root . left . right . left . left = new Node ( 20 ) ; tree . root . left . right . left . right = new Node ( 21 ) ; tree . root . left . right . right . left = new Node ( 22 ) ; tree . root . left . right . right . right = new Node ( 23 ) ; tree . root . right . left . left . left = new Node ( 24 ) ; tree . root . right . left . left . right = new Node ( 25 ) ; tree . root . right . left . right . left = new Node ( 26 ) ; tree . root . right . left . right . right = new Node ( 27 ) ; tree . root . right . right . left . left = new Node ( 28 ) ; tree . root . right . right . left . right = new Node ( 29 ) ; tree . root . right . right . right . left = new Node ( 30 ) ; tree . root . right . right . right . right = new Node ( 31 ) ; Console . WriteLine ( " Specific ▁ Level ▁ Order ▁ " + " traversal ▁ of ▁ binary " + " tree ▁ is ▁ " ) ; tree . printSpecificLevelOrder ( tree . root ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; using System . Collections . Generic ; public class MaxFlow { static readonly int V = 6 ; bool bfs ( int [ , ] rGraph , int s , int t , int [ ] parent ) { bool [ ] visited = new bool [ V ] ; for ( int i = 0 ; i < V ; ++ i ) visited [ i ] = false ; List < int > queue = new List < int > ( ) ; queue . Add ( s ) ; visited [ s ] = true ; parent [ s ] = - 1 ; while ( queue . Count != 0 ) { int u = queue [ 0 ] ; queue . RemoveAt ( 0 ) ; for ( int v = 0 ; v < V ; v ++ ) { if ( visited [ v ] == false && rGraph [ u , v ] > 0 ) { if ( v == t ) { parent [ v ] = u ; return true ; } queue . Add ( v ) ; parent [ v ] = u ; visited [ v ] = true ; } } } return false ; } int fordFulkerson ( int [ , ] graph , int s , int t ) { int u , v ; int [ , ] rGraph = new int [ V , V ] ; for ( u = 0 ; u < V ; u ++ ) for ( v = 0 ; v < V ; v ++ ) rGraph [ u , v ] = graph [ u , v ] ; int [ ] parent = new int [ V ] ; int max_flow = 0 ; while ( bfs ( rGraph , s , t , parent ) ) { int path_flow = int . MaxValue ; for ( v = t ; v != s ; v = parent [ v ] ) { u = parent [ v ] ; path_flow = Math . Min ( path_flow , rGraph [ u , v ] ) ; } for ( v = t ; v != s ; v = parent [ v ] ) { u = parent [ v ] ; rGraph [ u , v ] -= path_flow ; rGraph [ v , u ] += path_flow ; } max_flow += path_flow ; } return max_flow ; } public static void Main ( ) { int [ , ] graph = new int [ , ] { { 0 , 16 , 13 , 0 , 0 , 0 } , { 0 , 0 , 10 , 12 , 0 , 0 } , { 0 , 4 , 0 , 0 , 14 , 0 } , { 0 , 0 , 9 , 0 , 0 , 20 } , { 0 , 0 , 0 , 7 , 0 , 4 } , { 0 , 0 , 0 , 0 , 0 , 0 } } ; MaxFlow m = new MaxFlow ( ) ; Console . WriteLine ( " The ▁ maximum ▁ possible ▁ flow ▁ is ▁ " + m . fordFulkerson ( graph , 0 , 5 ) ) ; } }

Index/key variables: V, i, s, v
Accumulator variables: max_flow, u, v
Iterator variables: i, u, v
Class/struct names: MaxFlow
C# program:
using System ; using System . Collections . Generic ; class GFG { static int V = 8 ; static bool bfs ( int [ , ] rGraph , int s , int t , int [ ] parent ) { bool [ ] visited = new bool [ V ] ; Queue < int > q = new Queue < int > ( ) ; q . Enqueue ( s ) ; visited [ s ] = true ; parent [ s ] = - 1 ; while ( q . Count != 0 ) { int u = q . Peek ( ) ; q . Dequeue ( ) ; for ( int v = 0 ; v < V ; v ++ ) { if ( visited [ v ] == false && rGraph [ u , v ] > 0 ) { q . Enqueue ( v ) ; parent [ v ] = u ; visited [ v ] = true ; } } } return ( visited [ t ] == true ) ; } static int findDisjointPaths ( int [ , ] graph , int s , int t ) { int u , v ; int [ , ] rGraph = new int [ V , V ] ; for ( u = 0 ; u < V ; u ++ ) for ( v = 0 ; v < V ; v ++ ) rGraph [ u , v ] = graph [ u , v ] ; int [ ] parent = new int [ V ] ; int max_flow = 0 ; while ( bfs ( rGraph , s , t , parent ) ) { int path_flow = int . MaxValue ; for ( v = t ; v != s ; v = parent [ v ] ) { u = parent [ v ] ; path_flow = Math . Min ( path_flow , rGraph [ u , v ] ) ; } for ( v = t ; v != s ; v = parent [ v ] ) { u = parent [ v ] ; rGraph [ u , v ] -= path_flow ; rGraph [ v , u ] += path_flow ; } max_flow += path_flow ; } return max_flow ; } public static void Main ( String [ ] args ) { int [ , ] graph = { { 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 } , { 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 } , { 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 } , { 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 } , { 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 } , { 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 } , { 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 } , { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } } ; int s = 0 ; int t = 7 ; Console . WriteLine ( " There ▁ can ▁ be ▁ maximum ▁ " + findDisjointPaths ( graph , s , t ) + " ▁ edge - disjoint ▁ paths ▁ from ▁ " + s + " ▁ to ▁ " + t ) ; } }

Index/key variables: V, s, t, v
Accumulator variables: max_flow, u, v
Iterator variables: u, v
Class/struct names: GFG
C# program:
using System ; class GFG { static int M = 3 ; static int N = 3 ; static Boolean bpm ( int [ , ] table , int u , Boolean [ ] seen , int [ ] matchR ) { for ( int v = 0 ; v < N ; v ++ ) { if ( table [ u , v ] > 0 && ! seen [ v ] ) { seen [ v ] = true ; if ( matchR [ v ] < 0 || bpm ( table , matchR [ v ] , seen , matchR ) ) { matchR [ v ] = u ; return true ; } } } return false ; } static int maxBPM ( int [ , ] table ) { int [ ] matchR = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) matchR [ i ] = - 1 ; int result = 0 ; for ( int u = 0 ; u < M ; u ++ ) { Boolean [ ] seen = new Boolean [ N ] ; if ( bpm ( table , u , seen , matchR ) ) result ++ ; } Console . WriteLine ( " The ▁ number ▁ of ▁ maximum ▁ packets " + " ▁ sent ▁ in ▁ the ▁ time ▁ slot ▁ is ▁ " + result ) ; for ( int x = 0 ; x < N ; x ++ ) if ( matchR [ x ] + 1 != 0 ) Console . WriteLine ( " T " + ( matchR [ x ] + 1 ) + " - > ▁ R " + ( x + 1 ) ) ; return result ; } public static void Main ( String [ ] args ) { int [ , ] table = { { 0 , 2 , 0 } , { 3 , 0 , 1 } , { 2 , 4 , 0 } } ; maxBPM ( table ) ; } }

Index/key variables: N, i, v, x
Accumulator variables: i, result, u, v, x
Iterator variables: i, u, v, x
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class Node { public int data ; public Node left , right ; public Node ( int data ) { this . data = data ; left = right = null ; } } class GFG { public Node root ; public virtual void printSpecificLevelOrderUtil ( Node root , Stack < Node > s ) { if ( root == null ) { return ; } LinkedList < Node > q = new LinkedList < Node > ( ) ; q . AddLast ( root . left ) ; q . AddLast ( root . right ) ; Node first = null , second = null ; while ( q . Count > 0 ) { first = q . First . Value ; q . RemoveFirst ( ) ; second = q . First . Value ; q . RemoveFirst ( ) ; s . Push ( second . left ) ; s . Push ( first . right ) ; s . Push ( second . right ) ; s . Push ( first . left ) ; if ( first . left . left != null ) { q . AddLast ( first . right ) ; q . AddLast ( second . left ) ; q . AddLast ( first . left ) ; q . AddLast ( second . right ) ; } } } public virtual void printSpecificLevelOrder ( Node root ) { Stack < Node > s = new Stack < Node > ( ) ; s . Push ( root ) ; if ( root . left != null ) { s . Push ( root . right ) ; s . Push ( root . left ) ; } if ( root . left . left != null ) { printSpecificLevelOrderUtil ( root , s ) ; } while ( s . Count > 0 ) { Console . Write ( s . Peek ( ) . data + " ▁ " ) ; s . Pop ( ) ; } } public static void Main ( string [ ] args ) { GFG tree = new GFG ( ) ; tree . root = new Node ( 1 ) ; tree . root . left = new Node ( 2 ) ; tree . root . right = new Node ( 3 ) ; Console . WriteLine ( " Specific ▁ Level ▁ Order ▁ Traversal ▁ " + " of ▁ Binary ▁ Tree ▁ is ▁ " ) ; tree . printSpecificLevelOrder ( tree . root ) ; }

Class/struct names: GFG, Node
C# program:
if ( inMST [ v ] == false && key [ v ] > weight ) { key [ v ] = weight ; pq . Add ( new Tuple < int , int > ( key [ v ] , v ) ) ; parent [ v ] = u ; }

Index/key variables: v
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 value ) { data = value ; left = null ; right = null ; } } ; static void specific_level_order_traversal ( Node root ) { Queue < Node > q = new Queue < Node > ( ) ; Stack < List < int > > s = new Stack < List < int > > ( ) ; q . Enqueue ( root ) ; int sz ; while ( q . Count > 0 ) { List < int > v = new List < int > ( ) ; sz = q . Count ; for ( int i = 0 ; i < sz ; ++ i ) { Node temp = q . Peek ( ) ; q . Dequeue ( ) ; v . Add ( temp . data ) ; if ( temp . left != null ) q . Enqueue ( temp . left ) ; if ( temp . right != null ) q . Enqueue ( temp . right ) ; } s . Push ( v ) ; } while ( s . Count > 0 ) { List < int > v = s . Peek ( ) ; s . Pop ( ) ; for ( int i = 0 , j = v . Count - 1 ; i < j ; ++ i ) { Console . Write ( v [ i ] + " ▁ " + v [ j ] + " ▁ " ) ; j -- ; } } Console . WriteLine ( root . data ) ; } public static void Main ( String [ ] args ) { Node root = new Node ( 1 ) ; root . left = new Node ( 2 ) ; root . right = new Node ( 3 ) ; Console . WriteLine ( " Specific ▁ Level ▁ Order ▁ traversal " + " ▁ of ▁ binary ▁ tree ▁ is " ) ; specific_level_order_traversal ( root ) ; } }

Index/key variables: i, j
Accumulator variables: j
Iterator variables: i
Class/struct names: GFG, Node
C# program:
using System ; class GFG { int V = 4 ; void multiply ( int [ , ] A , int [ , ] B , int [ , ] C ) { for ( int i = 0 ; i < V ; i ++ ) { for ( int j = 0 ; j < V ; j ++ ) { C [ i , j ] = 0 ; for ( int k = 0 ; k < V ; k ++ ) { C [ i , j ] += A [ i , k ] * B [ k , j ] ; } } } } int getTrace ( int [ , ] graph ) { int trace = 0 ; for ( int i = 0 ; i < V ; i ++ ) { trace += graph [ i , i ] ; } return trace ; } int triangleInGraph ( int [ , ] graph ) { int [ , ] aux2 = new int [ V , V ] ; int [ , ] aux3 = new int [ V , V ] ; for ( int i = 0 ; i < V ; ++ i ) { for ( int j = 0 ; j < V ; ++ j ) { aux2 [ i , j ] = aux3 [ i , j ] = 0 ; } } multiply ( graph , graph , aux2 ) ; multiply ( graph , aux2 , aux3 ) ; int trace = getTrace ( aux3 ) ; return trace / 6 ; } public static void Main ( ) { GFG obj = new GFG ( ) ; int [ , ] graph = { { 0 , 1 , 1 , 0 } , { 1 , 0 , 1 , 1 } , { 1 , 1 , 0 , 1 } , { 0 , 1 , 1 , 0 } } ; Console . WriteLine ( " Total ▁ number ▁ of ▁ " + " Triangle ▁ in ▁ Graph ▁ : ▁ " + obj . triangleInGraph ( graph ) ) ; } }

Accumulator variables: i, j, k, trace
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GfG { public static int SIZE = 26 ; public static int binomialCoeff ( int n , int k ) { int res = 1 ; if ( k > n - k ) k = n - k ; for ( int i = 0 ; i < k ; ++ i ) { res *= ( n - i ) ; res /= ( i + 1 ) ; } return res ; } public static int countSubsequences ( String str , String str3 ) { int [ ] freq1 = new int [ SIZE ] ; int [ ] freq2 = new int [ SIZE ] ; char [ ] str1 = str . ToCharArray ( ) ; char [ ] str2 = str3 . ToCharArray ( ) ; int n1 = str . Length ; int n2 = str3 . Length ; for ( int i = 0 ; i < n1 ; i ++ ) freq1 [ str1 [ i ] - ' a ' ] ++ ; for ( int i = 0 ; i < n2 ; i ++ ) freq2 [ str2 [ i ] - ' a ' ] ++ ; int count = 1 ; for ( int i = 0 ; i < SIZE ; i ++ ) if ( freq2 [ i ] != 0 ) { if ( freq2 [ i ] <= freq1 [ i ] ) count = count * binomialCoeff ( freq1 [ i ] , freq2 [ i ] ) ; else return 0 ; } return count ; } public static void Main ( String [ ] argc ) { String str1 = " abacd " ; String str2 = " abc " ; Console . Write ( " Count ▁ = ▁ " + countSubsequences ( str1 , str2 ) ) ; } }

Index/key variables: SIZE, i
Accumulator variables: i, res
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GFG { static int [ ] fwd = new int [ 100 ] ; static int [ ] bwd = new int [ 100 ] ; static void preProcess ( string a , string b ) { int n = a . Length ; int j = 0 ; for ( int i = 1 ; i <= a . Length ; i ++ ) { if ( j < b . Length && a [ i - 1 ] == b [ j ] ) j ++ ; fwd [ i ] = j ; } j = 0 ; for ( int i = a . Length ; i >= 1 ; i -- ) { if ( j < b . Length && a [ i - 1 ] == b [ b . Length - j - 1 ] ) j ++ ; bwd [ i ] = j ; } } static void query ( string a , string b , int x , int y ) { if ( ( x - 1 + a . Length - y ) < b . Length ) { Console . Write ( " No STRNEWLINE " ) ; return ; } if ( fwd [ x - 1 ] + bwd [ y + 1 ] >= b . Length ) Console . Write ( " Yes STRNEWLINE " ) ; else Console . Write ( " No STRNEWLINE " ) ; } static void Main ( ) { string a = " abcabcxy " , b = " acy " ; preProcess ( a , b ) ; int x = 2 , y = 5 ; query ( a , b , x , y ) ; x = 3 ; y = 6 ; query ( a , b , x , y ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GfG { public static int findOccurrences ( string str1 , string substr1 ) { int counter = 0 ; for ( int i = 0 ; i < str1 . Length ; i ++ ) { if ( str1 [ i ] == substr1 [ 0 ] ) { for ( int j = i + 1 ; j < str1 . Length ; j ++ ) { if ( str1 [ j ] == substr1 [ 1 ] ) { for ( int k = j + 1 ; k < str1 . Length ; k ++ ) { if ( str1 [ k ] == substr1 [ 2 ] ) counter ++ ; } } } } } return counter ; } public static void Main ( ) { string str1 = " GFGFGYSYIOIWIN " ; string substr1 = " GFG " ; Console . WriteLine ( findOccurrences ( str1 , substr1 ) ) ; } }

Index/key variables: i, j, k
Accumulator variables: counter, i, j, k
Iterator variables: i, j, k
Class/struct names: GfG
C# program:
using System ; public class GfG { public static int findOccurrences ( string str1 , string substr1 ) { int n = str1 . Length ; int [ ] preLeft = new int [ n ] ; int [ ] preRight = new int [ n ] ; if ( str1 [ 0 ] == substr1 [ 0 ] ) preLeft [ 0 ] ++ ; for ( int i = 1 ; i < n ; i ++ ) { if ( str1 [ i ] == substr1 [ 0 ] ) preLeft [ i ] = preLeft [ i - 1 ] + 1 ; else preLeft [ i ] = preLeft [ i - 1 ] ; } if ( str1 [ n - 1 ] == substr1 [ 2 ] ) preRight [ n - 1 ] ++ ; for ( int i = n - 2 ; i >= 0 ; i -- ) { if ( str1 [ i ] == substr1 [ 2 ] ) preRight [ i ] = preRight [ i + 1 ] + 1 ; else preRight [ i ] = preRight [ i + 1 ] ; } int counter = 0 ; for ( int i = 1 ; i < n - 1 ; i ++ ) { if ( str1 [ i ] == str1 [ 1 ] ) { int total = preLeft [ i - 1 ] * preRight [ i + 1 ] ; counter += total ; } } return counter ; } public static void Main ( ) { string str1 = " GFGFGYSYIOIWIN " ; string substr1 = " GFG " ; Console . WriteLine ( findOccurrences ( str1 , substr1 ) ) ; } }

Index/key variables: i, n
Accumulator variables: counter, i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GFG { static void largestPalin ( char [ ] num , int n ) { if ( n <= 3 ) return ; int mid = n / 2 - 1 ; int [ ] rightMax = new int [ mid + 1 ] ; int right ; rightMax [ mid ] = - 1 ; right = mid ; for ( int i = mid - 1 ; i >= 0 ; i -- ) { if ( num [ i ] < num [ right ] ) rightMax [ i ] = right ; else { rightMax [ i ] = - 1 ; right = i ; } } for ( int i = 0 ; i <= mid ; i ++ ) { if ( rightMax [ i ] != - 1 ) { swap ( num , i , rightMax [ i ] ) ; swap ( num , n - i - 1 , n - rightMax [ i ] - 1 ) ; break ; } } } static char [ ] swap ( char [ ] arr , int i , int j ) { char temp = arr [ i ] ; arr [ i ] = arr [ j ] ; arr [ j ] = temp ; return arr ; } public static void Main ( String [ ] args ) { char [ ] num = "4697557964" . ToCharArray ( ) ; int n = num . Length ; largestPalin ( num , n ) ; Console . WriteLine ( " Largest ▁ Palindrome : ▁ " + String . Join ( " " , num ) ) ; } }

Index/key variables: i, j, mid, right
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String compute ( string str , int n ) { string reverseAlphabet = " zyxwvutsrqponmlkjihgfedcba " ; int l = str . Length ; String answer = " " ; for ( int i = 0 ; i < n ; i ++ ) answer = answer + str [ i ] ; for ( int i = n ; i < l ; i ++ ) answer = answer + reverseAlphabet [ str [ i ] - ' a ' ] ; return answer ; } public static void Main ( ) { string str = " pneumonia " ; int n = 4 ; Console . Write ( compute ( str , n - 1 ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findString ( String str , int n , int k ) { if ( k == 0 ) { Console . Write ( str ) ; ; return ; } String str2 = str ; int p = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( str2 [ i ] != ' a ' ) { str2 = str2 . Substring ( 0 , i ) + ' a ' + str2 . Substring ( i + 1 ) ; p ++ ; if ( p == k ) break ; } } if ( p < k ) { for ( int i = n - 1 ; i >= 0 ; i -- ) if ( str [ i ] == ' a ' ) { str2 = str2 . Substring ( 0 , i ) + ' b ' + str2 . Substring ( i + 1 ) ; p ++ ; if ( p == k ) break ; } } Console . Write ( str2 ) ; } public static void Main ( ) { String str = " pqrs " ; int n = str . Length ; int k = 2 ; findString ( str , n , k ) ; } }

Index/key variables: i
Accumulator variables: i, p
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static readonly int SIZE = 26 ; static bool isVowel ( char ch ) { if ( ch == ' a ' ch == ' e ' ch == ' i ' ch == ' o ' ch == ' u ' ) { return true ; } return false ; } static String createAltStr ( String str1 , String str2 , int start , int l ) { String finalStr = " " ; for ( int i = 0 , j = start ; j < l ; i ++ , j ++ ) { finalStr = ( finalStr + str1 [ i ] ) + str2 [ j ] ; } return finalStr ; } static String findAltStr ( String str ) { int [ ] char_freq = new int [ SIZE ] ; int nv = 0 , nc = 0 ; String vstr = " " , cstr = " " ; int l = str . Length ; for ( int i = 0 ; i < l ; i ++ ) { char ch = str [ i ] ; if ( isVowel ( ch ) ) { nv ++ ; } else { nc ++ ; } char_freq [ ch - 97 ] ++ ; } if ( Math . Abs ( nv - nc ) >= 2 ) { return " no ▁ such ▁ String " ; } for ( int i = 0 ; i < SIZE ; i ++ ) { char ch = ( char ) ( i + 97 ) ; for ( int j = 1 ; j <= char_freq [ i ] ; j ++ ) { if ( isVowel ( ch ) ) { vstr += ch ; } else { cstr += ch ; } } } if ( nv > nc ) { return ( vstr [ 0 ] + createAltStr ( cstr , vstr , 1 , nv ) ) ; } if ( nc > nv ) { return ( cstr [ 0 ] + createAltStr ( vstr , cstr , 1 , nc ) ) ; } if ( cstr [ 0 ] < vstr [ 0 ] ) { return createAltStr ( cstr , vstr , 0 , nv ) ; } return createAltStr ( vstr , cstr , 0 , nc ) ; } public static void Main ( String [ ] args ) { String str = " aeroplane " ; Console . WriteLine ( findAltStr ( str ) ) ; } }

Index/key variables: SIZE, i, j
Accumulator variables: cstr, i, j, nc, nv, vstr
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static readonly int SIZE = 100 ; static String base64Decoder ( char [ ] encoded , int len_str ) { char [ ] decoded_String ; decoded_String = new char [ SIZE ] ; int i , j , k = 0 ; int num = 0 ; int count_bits = 0 ; for ( i = 0 ; i < len_str ; i += 4 ) { num = 0 ; count_bits = 0 ; for ( j = 0 ; j < 4 ; j ++ ) { if ( encoded [ i + j ] != ' = ' ) { num = num << 6 ; count_bits += 6 ; } if ( encoded [ i + j ] >= ' A ' && encoded [ i + j ] <= ' Z ' ) num = num | ( encoded [ i + j ] - ' A ' ) ; else if ( encoded [ i + j ] >= ' a ' && encoded [ i + j ] <= ' z ' ) num = num | ( encoded [ i + j ] - ' a ' + 26 ) ; else if ( encoded [ i + j ] >= '0' && encoded [ i + j ] <= '9' ) num = num | ( encoded [ i + j ] - '0' + 52 ) ; else if ( encoded [ i + j ] == ' + ' ) num = num | 62 ; else if ( encoded [ i + j ] == ' / ' ) num = num | 63 ; else { num = num >> 2 ; count_bits -= 2 ; } } while ( count_bits != 0 ) { count_bits -= 8 ; decoded_String [ k ++ ] = ( char ) ( ( num >> count_bits ) & 255 ) ; } } return String . Join ( " " , decoded_String ) ; } public static void Main ( String [ ] args ) { char [ ] encoded_String = " TUVOT04 = " . ToCharArray ( ) ; int len_str = encoded_String . Length ; len_str -= 1 ; Console . Write ( " Encoded ▁ String ▁ : ▁ { 0 } STRNEWLINE " , String . Join ( " " , encoded_String ) ) ; Console . Write ( " Decoded _ String ▁ : ▁ { 0 } STRNEWLINE " , base64Decoder ( encoded_String , len_str ) ) ; } }

Index/key variables: SIZE
Accumulator variables: count_bits, i, j, k, len_str
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void printSubsequences ( String s ) { char [ ] str = s . ToCharArray ( ) ; int n = str . Length ; int opsize = ( int ) ( Math . Pow ( 2 , n - 1 ) ) ; for ( int counter = 0 ; counter < opsize ; counter ++ ) { for ( int j = 0 ; j < n ; j ++ ) { Console . Write ( str [ j ] ) ; if ( ( counter & ( 1 << j ) ) > 0 ) Console . Write ( " ▁ " ) ; } Console . WriteLine ( ) ; } } public static void Main ( ) { String str = " ABC " ; printSubsequences ( str ) ; } }

Index/key variables: j
Accumulator variables: counter, j
Iterator variables: counter, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static int MAX_CHAR = 26 ; static int MAX_FACT = 20 ; static long [ ] fact = new long [ MAX_FACT ] ; static void precomputeFactorirals ( ) { fact [ 0 ] = 1 ; for ( int i = 1 ; i < MAX_FACT ; i ++ ) fact [ i ] = fact [ i - 1 ] * i ; } static void nPermute ( String str , int n ) { precomputeFactorirals ( ) ; int len = str . Length ; int [ ] freq = new int [ MAX_CHAR ] ; for ( int i = 0 ; i < len ; i ++ ) freq [ str [ i ] - ' a ' ] ++ ; string ou = " " ; int sum = 10 ; int k = 0 ; while ( sum >= n ) { for ( int i = 0 ; i < MAX_CHAR ; i ++ ) { if ( freq [ i ] == 0 ) continue ; freq [ i ] -- ; sum = 0 ; int xsum = ( int ) fact [ len - 1 - k ] ; for ( int j = 0 ; j < MAX_CHAR ; j ++ ) xsum /= ( int ) ( fact [ freq [ j ] ] ) ; sum += xsum ; if ( sum >= n ) { ou += ( char ) ( i + ' a ' ) ; k ++ ; n -= ( sum - xsum ) ; break ; } if ( sum < n ) freq [ i ] ++ ; } } for ( int i = MAX_CHAR - 1 ; k < len && i >= 0 ; i -- ) if ( freq [ i ] != 0 ) { ou += ( char ) ( i + ' a ' ) ; freq [ i ++ ] -- ; } Console . Write ( ou ) ; } public static void Main ( ) { int n = 2 ; String str = " geeksquiz " ; nPermute ( str , n ) ; } }

Index/key variables: MAX_CHAR, MAX_FACT, i, j
Accumulator variables: i, j, k, n, ou, sum, xsum
Iterator variables: i, j
Class/struct names: GFG