dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; public class solution { public class Node { public int data ; public Node left , right ; } public static Node newNode ( int num ) { Node temp = new Node ( ) ; temp . data = num ; temp . left = temp . right = null ; return temp ; } public static Node insert ( Node root , int key ) { if ( root == null ) { return newNode ( key ) ; } if ( root . data > key ) { root . left = insert ( root . left , key ) ; } else { root . right = insert ( root . right , key ) ; } return root ; } public static void storeInorder ( Node ptr , List < int > vect ) { if ( ptr == null ) { return ; } storeInorder ( ptr . left , vect ) ; vect . Add ( ptr . data ) ; storeInorder ( ptr . right , vect ) ; } public static void pairSumUtil ( List < int > vect1 , List < int > vect2 , int sum ) { int left = 0 ; int right = vect2 . Count - 1 ; while ( left < vect1 . Count && right >= 0 ) { if ( vect1 [ left ] + vect2 [ right ] == sum ) { Console . Write ( " ( " + vect1 [ left ] + " , ▁ " + vect2 [ right ] + " ) , ▁ " ) ; left ++ ; right -- ; } else if ( vect1 [ left ] + vect2 [ right ] < sum ) { left ++ ; } else { right -- ; } } } public static void pairSum ( Node root1 , Node root2 , int sum ) { List < int > vect1 = new List < int > ( ) , vect2 = new List < int > ( ) ; storeInorder ( root1 , vect1 ) ; storeInorder ( root2 , vect2 ) ; pairSumUtil ( vect1 , vect2 , sum ) ; } public static void Main ( string [ ] args ) { Node root1 = null ; root1 = insert ( root1 , 8 ) ; root1 = insert ( root1 , 10 ) ; root1 = insert ( root1 , 3 ) ; root1 = insert ( root1 , 6 ) ; root1 = insert ( root1 , 1 ) ; root1 = insert ( root1 , 5 ) ; root1 = insert ( root1 , 7 ) ; root1 = insert ( root1 , 14 ) ; root1 = insert ( root1 , 13 ) ; Node root2 = null ; root2 = insert ( root2 , 5 ) ; root2 = insert ( root2 , 18 ) ; root2 = insert ( root2 , 2 ) ; root2 = insert ( root2 , 1 ) ; root2 = insert ( root2 , 3 ) ; root2 = insert ( root2 , 4 ) ; int sum = 10 ; pairSum ( root1 , root2 , sum ) ; } }

Index/key variables: left, right
Accumulator variables: left, right
Class/struct names: Node, solution
C# program:
using System ; public class solution { public static int min_diff , min_diff_key ; public class Node { public int key ; public Node left , right ; } public static Node newnode ( int key ) { Node node = new Node ( ) ; node . key = key ; node . left = node . right = null ; return ( node ) ; } public static void maxDiffUtil ( Node ptr , int k ) { if ( ptr == null ) { return ; } if ( ptr . key == k ) { min_diff_key = k ; return ; } if ( min_diff > Math . Abs ( ptr . key - k ) ) { min_diff = Math . Abs ( ptr . key - k ) ; min_diff_key = ptr . key ; } if ( k < ptr . key ) { maxDiffUtil ( ptr . left , k ) ; } else { maxDiffUtil ( ptr . right , k ) ; } } public static int maxDiff ( Node root , int k ) { min_diff = 999999999 ; min_diff_key = - 1 ; maxDiffUtil ( root , k ) ; return min_diff_key ; } public static void Main ( string [ ] args ) { Node root = newnode ( 9 ) ; root . left = newnode ( 4 ) ; root . right = newnode ( 17 ) ; root . left . left = newnode ( 3 ) ; root . left . right = newnode ( 6 ) ; root . left . right . left = newnode ( 5 ) ; root . left . right . right = newnode ( 7 ) ; root . right . right = newnode ( 22 ) ; root . right . right . left = newnode ( 20 ) ; int k = 18 ; Console . WriteLine ( maxDiff ( root , k ) ) ; } }

Class/struct names: Node, solution
C# program:
using System ; public class Tree { Node root ; public class Node { public int data ; public Node left , right ; public Node ( int data ) { this . data = data ; this . left = null ; this . right = null ; } } public Node insertLevelOrder ( int [ ] arr , Node root , int i ) { if ( i < arr . Length ) { Node temp = new Node ( arr [ i ] ) ; root = temp ; root . left = insertLevelOrder ( arr , root . left , 2 * i + 1 ) ; root . right = insertLevelOrder ( arr , root . right , 2 * i + 2 ) ; } return root ; } public void inOrder ( Node root ) { if ( root != null ) { inOrder ( root . left ) ; Console . Write ( root . data + " ▁ " ) ; inOrder ( root . right ) ; } } public static void Main ( String [ ] args ) { Tree t2 = new Tree ( ) ; int [ ] arr = { 1 , 2 , 3 , 4 , 5 , 6 , 6 , 6 , 6 } ; t2 . root = t2 . insertLevelOrder ( arr , t2 . root , 0 ) ; t2 . inOrder ( t2 . root ) ; } }

Index/key variables: i
Class/struct names: Node, Tree
C# program:
using System ; class node { public node left , right ; public int data ; public Boolean color ; public node ( int data ) { this . data = data ; left = null ; right = null ; color = true ; } } public class LLRBTREE { private static node root = null ; node rotateLeft ( node myNode ) { Console . Write ( " left ▁ rotation ! ! STRNEWLINE " ) ; node child = myNode . right ; node childLeft = child . left ; child . left = myNode ; myNode . right = childLeft ; return child ; } node rotateRight ( node myNode ) { Console . Write ( " right ▁ rotation STRNEWLINE " ) ; node child = myNode . left ; node childRight = child . right ; child . right = myNode ; myNode . left = childRight ; return child ; } Boolean isRed ( node myNode ) { if ( myNode == null ) return false ; return ( myNode . color == true ) ; } void swapColors ( node node1 , node node2 ) { Boolean temp = node1 . color ; node1 . color = node2 . color ; node2 . color = temp ; } node insert ( node myNode , int data ) { if ( myNode == null ) return new node ( data ) ; if ( data < myNode . data ) myNode . left = insert ( myNode . left , data ) ; else if ( data > myNode . data ) myNode . right = insert ( myNode . right , data ) ; else return myNode ; if ( isRed ( myNode . right ) && ! isRed ( myNode . left ) ) { myNode = rotateLeft ( myNode ) ; swapColors ( myNode , myNode . left ) ; } if ( isRed ( myNode . left ) && isRed ( myNode . left . left ) ) { myNode = rotateRight ( myNode ) ; swapColors ( myNode , myNode . right ) ; } if ( isRed ( myNode . left ) && isRed ( myNode . right ) ) { myNode . color = ! myNode . color ; myNode . left . color = false ; myNode . right . color = false ; } return myNode ; } void inorder ( node node ) { if ( node != null ) { inorder ( node . left ) ; Console . Write ( node . data + " ▁ " ) ; inorder ( node . right ) ; } } static public void Main ( String [ ] args ) { LLRBTREE node = new LLRBTREE ( ) ; root = node . insert ( root , 10 ) ; root . color = false ; root = node . insert ( root , 20 ) ; root . color = false ; root = node . insert ( root , 30 ) ; root . color = false ; root = node . insert ( root , 40 ) ; root . color = false ; root = node . insert ( root , 50 ) ; root . color = false ; root = node . insert ( root , 25 ) ; root . color = false ; node . inorder ( root ) ; } }

Boolean variables: color
Class/struct names: LLRBTREE, node
C# program:
public class Node { public int data ; public Node left , right ; public bool rightThread ; }

Class/struct names: Node
C# program:
using System ; class GFG { public static int preindex ; public class node { public int data ; public node left , right ; public node ( int data ) { this . data = data ; } } public static node constructTreeUtil ( int [ ] pre , int [ ] post , int l , int h , int size ) { if ( preindex >= size l > h ) { return null ; } node root = new node ( pre [ preindex ] ) ; preindex ++ ; if ( l == h preindex >= size ) { return root ; } int i ; for ( i = l ; i <= h ; i ++ ) { if ( post [ i ] == pre [ preindex ] ) { break ; } } if ( i <= h ) { root . left = constructTreeUtil ( pre , post , l , i , size ) ; root . right = constructTreeUtil ( pre , post , i + 1 , h , size ) ; } return root ; } public static node constructTree ( int [ ] pre , int [ ] post , int size ) { preindex = 0 ; return constructTreeUtil ( pre , post , 0 , size - 1 , size ) ; } public static void printInorder ( node root ) { if ( root == null ) { return ; } printInorder ( root . left ) ; Console . Write ( root . data + " ▁ " ) ; printInorder ( root . right ) ; } public static void Main ( string [ ] args ) { int [ ] pre = new int [ ] { 1 , 2 , 4 , 8 , 9 , 5 , 3 , 6 , 7 } ; int [ ] post = new int [ ] { 8 , 9 , 4 , 5 , 2 , 6 , 7 , 3 , 1 } ; int size = pre . Length ; node root = constructTree ( pre , post , size ) ; Console . WriteLine ( " Inorder ▁ traversal ▁ of ▁ " + " the ▁ constructed ▁ tree : " ) ; printInorder ( root ) ; } }

Index/key variables: i, preindex
Accumulator variables: i, preindex
Iterator variables: i
Class/struct names: GFG, node
C# program:
using System ; public class solution { public class Node { public int key ; public Node left , right ; public bool isThreaded ; } public static Node createThreaded ( Node root ) { if ( root == null ) { return null ; } if ( root . left == null && root . right == null ) { return root ; } if ( root . left != null ) { Node l = createThreaded ( root . left ) ; l . right = root ; l . isThreaded = true ; } if ( root . right == null ) { return root ; } return createThreaded ( root . right ) ; } public static Node leftMost ( Node root ) { while ( root != null && root . left != null ) { root = root . left ; } return root ; } public static void inOrder ( Node root ) { if ( root == null ) { return ; } Node cur = leftMost ( root ) ; while ( cur != null ) { Console . Write ( cur . key + " ▁ " ) ; if ( cur . isThreaded ) { cur = cur . right ; } else { cur = leftMost ( cur . right ) ; } } } public static Node newNode ( int key ) { Node temp = new Node ( ) ; temp . left = temp . right = null ; temp . key = key ; return temp ; } 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 ) ; root . right . left = newNode ( 6 ) ; root . right . right = newNode ( 7 ) ; createThreaded ( root ) ; Console . WriteLine ( " Inorder ▁ traversal ▁ of ▁ created ▁ " + " threaded ▁ tree ▁ is STRNEWLINE " ) ; inOrder ( root ) ; } }

Boolean variables: isThreaded
Class/struct names: Node, solution
C# program:
using System ; class Node { public int key ; public Node left , right , parent ; public Node ( int key ) { this . key = key ; left = right = parent = null ; } } class BinaryTree { Node root ; Node insert ( Node node , int key ) { if ( node == null ) return new Node ( key ) ; if ( key < node . key ) { node . left = insert ( node . left , key ) ; node . left . parent = node ; } else if ( key > node . key ) { node . right = insert ( node . right , key ) ; node . right . parent = node ; } return node ; } void inorder ( Node root ) { Boolean leftdone = false ; while ( root != null ) { if ( ! leftdone ) { while ( root . left != null ) { root = root . left ; } } Console . Write ( root . key + " ▁ " ) ; leftdone = true ; if ( root . right != null ) { leftdone = false ; root = root . right ; } else if ( root . parent != null ) { while ( root . parent != null && root == root . parent . right ) root = root . parent ; if ( root . parent == null ) break ; root = root . parent ; } else break ; } } static public void Main ( String [ ] args ) { BinaryTree tree = new BinaryTree ( ) ; tree . root = tree . insert ( tree . root , 24 ) ; tree . root = tree . insert ( tree . root , 27 ) ; tree . root = tree . insert ( tree . root , 29 ) ; tree . root = tree . insert ( tree . root , 34 ) ; tree . root = tree . insert ( tree . root , 14 ) ; tree . root = tree . insert ( tree . root , 4 ) ; tree . root = tree . insert ( tree . root , 10 ) ; tree . root = tree . insert ( tree . root , 22 ) ; tree . root = tree . insert ( tree . root , 13 ) ; tree . root = tree . insert ( tree . root , 3 ) ; tree . root = tree . insert ( tree . root , 2 ) ; tree . root = tree . insert ( tree . root , 6 ) ; Console . WriteLine ( " Inorder ▁ traversal ▁ is ▁ " ) ; tree . inorder ( tree . root ) ; } }

Boolean variables: leftdone
Class/struct names: BinaryTree, Node
C# program:
using System ; class GFG { static private void printSorted ( int [ ] arr , int start , int end ) { if ( start > end ) return ; printSorted ( arr , start * 2 + 1 , end ) ; Console . Write ( arr [ start ] + " ▁ " ) ; printSorted ( arr , start * 2 + 2 , end ) ; } static public void Main ( String [ ] args ) { int [ ] arr = { 4 , 2 , 5 , 1 , 3 } ; printSorted ( arr , 0 , arr . Length - 1 ) ; } }

Index/key variables: start
Class/struct names: GFG
C# program:
using System ; public class Node { public int data ; public Node left , right ; public Node ( int d ) { data = d ; left = right = null ; } } public class BinaryTree { public static Node root ; public virtual int Ceil ( Node node , int input ) { if ( node == null ) { return - 1 ; } if ( node . data == input ) { return node . data ; } if ( node . data < input ) { return Ceil ( node . right , input ) ; } int ceil = Ceil ( node . left , input ) ; return ( ceil >= input ) ? ceil : node . data ; } public static void Main ( string [ ] args ) { BinaryTree tree = new BinaryTree ( ) ; BinaryTree . root = new Node ( 8 ) ; BinaryTree . root . left = new Node ( 4 ) ; BinaryTree . root . right = new Node ( 12 ) ; BinaryTree . root . left . left = new Node ( 2 ) ; BinaryTree . root . left . right = new Node ( 6 ) ; BinaryTree . root . right . left = new Node ( 10 ) ; BinaryTree . root . right . right = new Node ( 14 ) ; for ( int i = 0 ; i < 16 ; i ++ ) { Console . WriteLine ( i + " ▁ " + tree . Ceil ( root , i ) ) ; } } }

Accumulator variables: i
Iterator variables: i
Class/struct names: BinaryTree, Node
C# program:
using System ; class GFG { public class Node { public int data ; public Node left , right ; } ; public class INT { public int a ; public INT ( int a ) { this . a = a ; } } static Node newNode ( int data ) { Node temp = new Node ( ) ; temp . data = data ; temp . left = temp . right = null ; return temp ; } static void printInorder ( Node node ) { if ( node == null ) return ; printInorder ( node . left ) ; Console . Write ( " { 0 } ▁ " , node . data ) ; printInorder ( node . right ) ; } static Node conBinaryTreeUtil ( int [ ] pre , int [ ] preM , INT preIndex , int l , int h , int size ) { if ( preIndex . a >= size l > h ) return null ; Node root = newNode ( pre [ preIndex . a ] ) ; ++ ( preIndex . a ) ; if ( l == h ) return root ; int i ; for ( i = l ; i <= h ; ++ i ) if ( pre [ preIndex . a ] == preM [ i ] ) break ; if ( i <= h ) { root . left = conBinaryTreeUtil ( pre , preM , preIndex , i , h , size ) ; root . right = conBinaryTreeUtil ( pre , preM , preIndex , l + 1 , i - 1 , size ) ; } return root ; } static void conBinaryTree ( Node root , int [ ] pre , int [ ] preMirror , int size ) { INT preIndex = new INT ( 0 ) ; int preMIndex = 0 ; root = conBinaryTreeUtil ( pre , preMirror , preIndex , 0 , size - 1 , size ) ; printInorder ( root ) ; } public static void Main ( String [ ] args ) { int [ ] preOrder = { 1 , 2 , 4 , 5 , 3 , 6 , 7 } ; int [ ] preOrderMirror = { 1 , 3 , 7 , 6 , 2 , 5 , 4 } ; int size = preOrder . Length ; Node root = new Node ( ) ; conBinaryTree ( root , preOrder , preOrderMirror , size ) ; } }

Index/key variables: i
Iterator variables: i
Class/struct names: GFG, INT, Node
C# program:
using System ; public class Node { public int data ; public Node left , right ; public Node ( int d ) { data = d ; left = right = null ; } } public class BinaryTree { public static Node root ; int floor ; int ceil ; public int floorCeilBSTHelper ( Node root , int key ) { while ( root != null ) { if ( root . data == key ) { ceil = root . data ; floor = root . data ; return 0 ; } if ( key > root . data ) { floor = root . data ; root = root . right ; } else { ceil = root . data ; root = root . left ; } } return 0 ; } public void floorCeilBST ( Node root , int key ) { floor = - 1 ; ceil = - 1 ; floorCeilBSTHelper ( root , key ) ; Console . WriteLine ( key + " ▁ " + floor + " ▁ " + ceil ) ; } static public void Main ( ) { BinaryTree tree = new BinaryTree ( ) ; BinaryTree . root = new Node ( 8 ) ; BinaryTree . root . left = new Node ( 4 ) ; BinaryTree . root . right = new Node ( 12 ) ; BinaryTree . root . left . left = new Node ( 2 ) ; BinaryTree . root . left . right = new Node ( 6 ) ; BinaryTree . root . right . left = new Node ( 10 ) ; BinaryTree . root . right . right = new Node ( 14 ) ; for ( int i = 0 ; i < 16 ; i ++ ) { tree . floorCeilBST ( BinaryTree . root , i ) ; } } }

Accumulator variables: i
Iterator variables: i
Class/struct names: BinaryTree, Node
C# program:
using System ; class GFG { public class node { public int key ; public int count ; public node left , right ; } ; static node newNode ( int item ) { node temp = new node ( ) ; temp . key = item ; temp . left = temp . right = null ; temp . count = 1 ; return temp ; } static void inorder ( node root ) { if ( root != null ) { inorder ( root . left ) ; Console . Write ( root . key + " ( " + root . count + " ) ▁ " ) ; inorder ( root . right ) ; } } static node insert ( node node , int key ) { if ( node == null ) return newNode ( key ) ; if ( key == node . key ) { ( node . count ) ++ ; return node ; } if ( key < node . key ) node . left = insert ( node . left , key ) ; else node . right = insert ( node . right , key ) ; return node ; } static node minValueNode ( node node ) { node current = node ; while ( current . left != null ) current = current . left ; return current ; } static node deleteNode ( node root , int key ) { if ( root == null ) return root ; if ( key < root . key ) root . left = deleteNode ( root . left , key ) ; else if ( key > root . key ) root . right = deleteNode ( root . right , key ) ; else { if ( root . count > 1 ) { ( root . count ) -- ; return root ; } node temp = null ; if ( root . left == null ) { temp = root . right ; root = null ; return temp ; } else if ( root . right == null ) { temp = root . left ; root = null ; return temp ; } temp = minValueNode ( root . right ) ; root . key = temp . key ; root . right = deleteNode ( root . right , temp . key ) ; } return root ; } public static void Main ( String [ ] args ) { node root = null ; root = insert ( root , 12 ) ; root = insert ( root , 10 ) ; root = insert ( root , 20 ) ; root = insert ( root , 9 ) ; root = insert ( root , 11 ) ; root = insert ( root , 10 ) ; root = insert ( root , 12 ) ; root = insert ( root , 12 ) ; Console . Write ( " Inorder ▁ traversal ▁ of ▁ " + " the ▁ given ▁ tree ▁ " + " STRNEWLINE " ) ; inorder ( root ) ; Console . Write ( " STRNEWLINE Delete ▁ 20 STRNEWLINE " ) ; root = deleteNode ( root , 20 ) ; Console . Write ( " Inorder ▁ traversal ▁ of ▁ " + " the ▁ modified ▁ tree ▁ STRNEWLINE " ) ; inorder ( root ) ; Console . Write ( " STRNEWLINE Delete ▁ 12 STRNEWLINE " ) ; root = deleteNode ( root , 12 ) ; Console . Write ( " Inorder ▁ traversal ▁ of ▁ " + " the ▁ modified ▁ tree ▁ STRNEWLINE " ) ; inorder ( root ) ; Console . Write ( " STRNEWLINE Delete ▁ 9 STRNEWLINE " ) ; root = deleteNode ( root , 9 ) ; Console . Write ( " Inorder ▁ traversal ▁ of ▁ " + " the ▁ modified ▁ tree ▁ STRNEWLINE " ) ; inorder ( root ) ; } }

Class/struct names: GFG, node
C# program:
using System ; class GFG { public class node { public int key ; public node left , right ; } static node root = null ; static node newNode ( int item ) { node temp = new node ( ) ; temp . key = item ; temp . left = null ; temp . right = null ; return temp ; } static void inorder ( node root ) { if ( root != null ) { inorder ( root . left ) ; Console . Write ( root . key + " ▁ " ) ; inorder ( root . right ) ; } } static node insert ( node node , int key ) { if ( node == null ) return newNode ( key ) ; if ( key < node . key ) node . left = insert ( node . left , key ) ; else node . right = insert ( node . right , key ) ; return node ; } static node minValueNode ( node Node ) { node current = Node ; while ( current . left != null ) current = current . left ; return current ; } static node deleteNode ( node root , int key ) { node temp = null ; if ( root == null ) return root ; if ( key < root . key ) root . left = deleteNode ( root . left , key ) ; else if ( key > root . key ) root . right = deleteNode ( root . right , key ) ; else { if ( root . left == null ) { temp = root . right ; return temp ; } else if ( root . right == null ) { temp = root . left ; return temp ; } temp = minValueNode ( root . right ) ; root . key = temp . key ; root . right = deleteNode ( root . right , temp . key ) ; } return root ; } static node changeKey ( node root , int oldVal , int newVal ) { root = deleteNode ( root , oldVal ) ; root = insert ( root , newVal ) ; return root ; } public static void Main ( String [ ] args ) { root = insert ( root , 50 ) ; root = insert ( root , 30 ) ; root = insert ( root , 20 ) ; root = insert ( root , 40 ) ; root = insert ( root , 70 ) ; root = insert ( root , 60 ) ; root = insert ( root , 80 ) ; Console . WriteLine ( " Inorder ▁ traversal ▁ " + " of ▁ the ▁ given ▁ tree ▁ " ) ; inorder ( root ) ; root = changeKey ( root , 40 , 10 ) ; Console . WriteLine ( " STRNEWLINE Inorder ▁ traversal ▁ " + " of ▁ the ▁ modified ▁ tree " ) ; inorder ( root ) ; } }

Class/struct names: GFG, node
C# program:
using System ; using System . Collections . Generic ; public class GfG { public class Node { public int key ; public Node left , right ; } public static Node newNode ( int ele ) { Node temp = new Node ( ) ; temp . key = ele ; temp . left = null ; temp . right = null ; return temp ; } public static void printCommon ( Node root1 , Node root2 ) { Stack < Node > s1 = new Stack < Node > ( ) ; Stack < Node > s2 = new Stack < Node > ( ) ; while ( true ) { if ( root1 != null ) { s1 . Push ( root1 ) ; root1 = root1 . left ; } else if ( root2 != null ) { s2 . Push ( root2 ) ; root2 = root2 . left ; } else if ( s1 . Count > 0 && s2 . Count > 0 ) { root1 = s1 . Peek ( ) ; root2 = s2 . Peek ( ) ; if ( root1 . key == root2 . key ) { Console . Write ( root1 . key + " ▁ " ) ; s1 . Pop ( ) ; s2 . Pop ( ) ; root1 = root1 . right ; root2 = root2 . right ; } else if ( root1 . key < root2 . key ) { s1 . Pop ( ) ; root1 = root1 . right ; root2 = null ; } else if ( root1 . key > root2 . key ) { s2 . Pop ( ) ; root2 = root2 . right ; root1 = null ; } } else { break ; } } } public static void inorder ( Node root ) { if ( root != null ) { inorder ( root . left ) ; Console . Write ( root . key + " ▁ " ) ; inorder ( root . right ) ; } } public static Node insert ( Node node , int key ) { if ( node == null ) { return newNode ( key ) ; } if ( key < node . key ) { node . left = insert ( node . left , key ) ; } else if ( key > node . key ) { node . right = insert ( node . right , key ) ; } return node ; } public static void Main ( string [ ] args ) { Node root1 = null ; root1 = insert ( root1 , 5 ) ; root1 = insert ( root1 , 1 ) ; root1 = insert ( root1 , 10 ) ; root1 = insert ( root1 , 0 ) ; root1 = insert ( root1 , 4 ) ; root1 = insert ( root1 , 7 ) ; root1 = insert ( root1 , 9 ) ; Node root2 = null ; root2 = insert ( root2 , 10 ) ; root2 = insert ( root2 , 7 ) ; root2 = insert ( root2 , 20 ) ; root2 = insert ( root2 , 4 ) ; root2 = insert ( root2 , 9 ) ; Console . Write ( " Tree ▁ 1 ▁ : ▁ " + " STRNEWLINE " ) ; inorder ( root1 ) ; Console . WriteLine ( ) ; Console . Write ( " Tree ▁ 2 ▁ : ▁ " + " STRNEWLINE " ) ; inorder ( root2 ) ; Console . WriteLine ( ) ; Console . Write ( " Common ▁ Nodes : ▁ " + " STRNEWLINE " ) ; printCommon ( root1 , root2 ) ; } }

Class/struct names: GfG, Node