@@ -35,11 +35,13 @@ public Tree intialize(){
3535 if (temp .equalsIgnoreCase ("yes" )||temp .equalsIgnoreCase ("y" )||temp .equalsIgnoreCase ("1" )){
3636 int t =Integer .valueOf (parentID );
3737 bTree .binaryTree [t ].hasLeft =true ;
38+ bTree .binaryTree [t ].HasLeftUA =true ;
3839 bTree .binaryTree [t ].leftNodeID =bTree .binaryTree [i ].nodeID ;
3940 }
4041 else {
4142 int t =Integer .valueOf (parentID );
4243 bTree .binaryTree [t ].hasRight = true ;
44+ bTree .binaryTree [t ].HasRightUA =true ;
4345 bTree .binaryTree [t ].rightNodeID =bTree .binaryTree [i ].nodeID ;
4446 }
4547 }
@@ -64,23 +66,22 @@ public void displayAll(Tree bTree){
6466 System .out .println ("isRoot :" +bTree .binaryTree [i ].isRoot );
6567 System .out .println ("Data :" +bTree .binaryTree [i ].Data );
6668 System .out .println ("Number of Children Nodes :" +bTree .binaryTree [i ].childrenNodeCount );
67- System .out .println ("hasLeft :" +bTree .binaryTree [i ].hasLeft );
68- if (bTree .binaryTree [i ].hasLeft )
69+ System .out .println ("hasLeft :" +bTree .binaryTree [i ].HasLeftUA );
70+ if (bTree .binaryTree [i ].HasLeftUA )
6971 System .out .println ("LeftNodeID :" +bTree .binaryTree [i ].leftNodeID );
70- System .out .println ("hasRight :" +bTree .binaryTree [i ].hasRight );
71- if (bTree .binaryTree [i ].hasRight )
72+ System .out .println ("hasRight :" +bTree .binaryTree [i ].HasRightUA );
73+ if (bTree .binaryTree [i ].HasRightUA )
7274 System .out .println ("RightNodeID :" +bTree .binaryTree [i ].rightNodeID );
7375 System .out .println ("parentID :" +bTree .binaryTree [i ].fetchRoot ());
7476 System .out .println ("SiblingPairs (if any) :" +bTree .binaryTree [i ].fetchSiblingID ());
7577 System .out .println ("____________________________________________________________________________" );
7678 }
7779 System .out .println ("Tree Specifications" );
78- System .out .println ("Total No. of Nodes :" +bTree .count );
79- System .out .println ("Height of Tree :" +bTree .height );
80- System .out .println ("Depth of Tree :" +bTree .depth );
81- System .out .println ("Leaves :" +bTree .leaves .trim ());
82- System .out .println ("Sibling Pairs :" +bTree .siblingPairs .trim ());
83- System .out .println ("Traversal :" +bTree .Traversal );
84- System .out .println ("Traversal Pre-Order :" +bTree .TraversalPre );
80+ System .out .println ("Total No. of Nodes :" +bTree .count );
81+ System .out .println ("Height of Tree :" +bTree .height );
82+ System .out .println ("Depth of Tree :" +bTree .depth );
83+ System .out .println ("Leaves :" +bTree .leaves .trim ());
84+ System .out .println ("Sibling Pairs :" +bTree .siblingPairs .trim ());
85+ System .out .println ("Traversal :" +bTree .Traversal );
8586 }
8687}
0 commit comments