A question on a build method in a Binary Tree Program

So I'm working on making 20 Questions in java and I'm supposed to make a construct that calls a build method.
I'll post my code as I have it so far.
The game is supposed to work so that there's an original question and then if the user selects yes, then the answer goes to the left link. The no answer goes to the right link and then it keeps going yes for the left, no for the right.
How do I call the build method recursively to do that?
public class GameTree {
* BinaryTreeNode inner class used to create new nodes in the GameTree.
private class BinaryTreeNode {
private String data;
private BinaryTreeNode left;
private BinaryTreeNode right;
BinaryTreeNode(String theData) {
data = theData;
left = null;
right = null;
BinaryTreeNode(String theData, BinaryTreeNode leftLink, BinaryTreeNode rightLink) {
data = theData;
left = leftLink;
right = rightLink;
* instance variables.
private BinaryTreeNode root;
private Scanner my_inputFile;
private String currentFileName;
private BinaryTreeNode currentNodeReferenceInTree;
* Constructor needed to create the game.
* @param name
* this is the name of the file we need to import the game questions
* and answers from.
public GameTree(String name) {
// TODO: Complete this method
     currentFileName = name;
     try {
          my_inputFile = new Scanner(new File(currentFileName));
     catch (FileNotFoundException e) {
     root = build();
     my_inputFile.close();
public BinaryTreeNode build() {
     String token2 = my_inputFile.nextLine();
     if(!isQuestion(token2))
          return new BinaryTreeNode(token2);
     else{
          BinaryTreeNode rightTreeSide = build();
          BinaryTreeNode leftTreeSide = build();
          return new BinaryTreeNode(token2,leftTreeSide, rightTreeSide);
* Ask the game to update the current node by going left for Choice.yes or
* right for Choice.no Example code: theGame.playerSelected(Choice.Yes);
* @param yesOrNo
public void playerSelected(Choice yesOrNo) {
     if(userSelection == Choice.No)
          currentNodeReferenceInTree = currentNodeReferenceInTree.right;
     if(userSelection == Choice.Yes)
          currentNodeReferenceInTree = currentNodeReferenceInTree.left;
I have a separate .java that already says
public enum Choice {
Yes, No
};

When you post code, wrap it in code tags so it's legible. When you're inputting the text, highlight it, and then click the "CODE" button above the text input box. It can be almost impossible to read code that's not formatted like that.
You ask "How do I call the build method recursively to do that?" You don't call recursive methods any differently than you call any other kind of method. Can you clarify what difficulty you're having?

Similar Messages

  • Creating Insert Method for a binary tree

    I have code for a binary tree http://sourcepost.sytes.net/sourceview.aspx?source_id=5046
    I'm trying to create an insert method that will accept an element and insert it into my binary tree. The main purpose of this is to test my traversal functions, intrav(), postrav(), pretrav(). I have another class that will create 10 random numbers and call insert() to insert them into my tree. Can anyone help me write this method?

    anyone?

  • What is wrong with my delete method in my binary tree

    code..okay so somehow everytime I delete a number that exist it says it has been deleted later when..I display the tree the node wasn' t really deleted at all here is the code..
         public boolean delete(int numbers)
              Node now = rootOrigin;
              Node ancestor = rootOrigin;
              boolean isLeftChild = true;
              if(find(numbers)!= null)
                   if((now.LeftChildOfMine == null)&&(now.RightChildOfMine == null))
                        if(now == rootOrigin)
                             rootOrigin = null;
                        else if(isLeftChild)
                             ancestor.LeftChildOfMine = null;
                        else
                             ancestor.RightChildOfMine = null;
                   else if((now.LeftChildOfMine != null)&&(now.RightChildOfMine == null))
                        if(now==rootOrigin)
                             now = now.LeftChildOfMine;
                        else if(isLeftChild)
                             ancestor.LeftChildOfMine = now.LeftChildOfMine;
                        else
                             ancestor.RightChildOfMine = now.LeftChildOfMine;
                   else if((now.LeftChildOfMine == null)&&(now.RightChildOfMine != null))
                        if(now==rootOrigin)
                             rootOrigin = now.RightChildOfMine;
                        else if(isLeftChild)
                             //ancestor.LeftChildOfMine = now.RightChildOfMine;
                             ancestor.RightChildOfMine = now.LeftChildOfMine;
                        else
                             //ancestor.RightChildOfMine = now.RightChildOfMine;
                             ancestor.LeftChildOfMine = now.RightChildOfMine;
                   else if((now.LeftChildOfMine != null)&&(now.RightChildOfMine != null))
                        //get successor of node to delete(current)
                        Node successor = getSuccessor(now);
                        //connect parent of current to successor instead
                        if (now == rootOrigin)
                             rootOrigin = successor;
                        else if(isLeftChild)
                             ancestor.LeftChildOfMine = successor;
                        else
                             ancestor.RightChildOfMine = successor; //connect successor to current's left child
                        successor.LeftChildOfMine = now.LeftChildOfMine;
              return true;     
              else
                   return false;
         }Also here is the method that finds the successor of the node that will replace the node that i want to delete
         private Node getSuccessor(Node delNode)
              Node successorParent = delNode;
              Node successor = delNode ;
              Node now = delNode.RightChildOfMine;
              while(now != null)
                   successorParent = successor;
                   successor = now;
                   now = now.LeftChildOfMine;
              if(successor != delNode.RightChildOfMine)
                   successorParent.LeftChildOfMine = successor.RightChildOfMine;
                   successor.RightChildOfMine = delNode.RightChildOfMine;
                   return successor;
         }Okay also a while ago when I focused on traversing(nodes kept displaying more than once) my prof. said the problem was in my insertion method.
    It mayber the insertion method's fault again
         public void insert(int numbers)
              Node newNode = new Node(numbers);
              if(rootOrigin == null)     
                   rootOrigin = newNode;     // newNode will be the root of the tree
              else
                   Node current = rootOrigin;
                   Node parent;
                   while(true)
                        parent = current;
                        if(numbers < current.numbers)
                             current = current.LeftChildOfMine;
                             if(current == null)
                                  parent.LeftChildOfMine = newNode;
                                  return;
                        else
                             current = current.RightChildOfMine;
                             if(current == null)
                                  parent.RightChildOfMine = newNode;
                                  return;
         }

    DaDonYordel wrote:
              if(find(numbers)!= null)
                   if((now.LeftChildOfMine == null)&&(now.RightChildOfMine == null))Shouldn't you be assigning the result of the find() to now?

  • Reporting Against Level Reference Build Method

    All,
    I created a hierarchy in Essbase using the Level Reference build method since the data is in a bottom-up. The data is laid out like so:
    Statement
    --Assets
    ----Calc 1
    ------Calc 2
    --------Major Category 1
    --------Major Category 2
    --------Major Category 3
    ------Major Category 4
    ----Major Category 5
    --Liabilities
    ----Major Category 6
    Originally I had this in a generation reference, but that didn't work since we don't have a consistent number of layers for each item. Next I was thinking a parent-child relationship, but this doesnt work because major categories fall at different levels. Finally, I'm thinking level reference is the way to go since we can have different layers of parents for each lowest level member and the data can be laid out the way we need. (Let me know if you disagree with this approach).
    This works fine in the cube...however, when I import this into the BI Administration tool it only sees generations, not levels. How can I get it to pull in the levels so that I can add individual levels to a report?
    I'm planning on following this method to create the report: http://oraclebizint.wordpress.com/2008/01/10/oracle-bi-ee-101332-achieving-financial-template-layouts-using-pivot-tables/. However, when I do that with generations it has blanks because not all of the major categories are at the same generation. I'm hoping levels will clear this up, but if anyone has a suggestion of a different way to achieve this layout let me know.
    Thanks!

    Hi Corel,
    I am stucking on how and where to call the recursive function for performing Tree-level hierarchy for my above code.!
    in my hierarchy level, one parent has multiple children which in turn so many children and so on... if i am in the least level node , then i need to get the details of its related nodes which has been linked by that node.
    For ex: i have the structure somthing like below:
    Parent
    / | \
    child1 child2 child3
    |
    c5
    |
    c6
    In the above structure, Parent and its children sharing the same address id(56122). Suppose, If i am in c6, then i could get the references for C6->C5->child2->Parent as the hierarchy from ResultSet. child1 and child3 has been ignored ,since there is no implementation for saving their references.
    I am stucking here that i dont know how to save these ref. and get them too in the company hierarchy structure. Remember , i need to refer only the company which is sharing the same address id. there could be other address id assosiated with other children (not included here)
    any suggestion how to save the references by implementing recursive procedure from the resultset.
    thanks in advance

  • Does essbase studio support Parent/Child build method

    Hi,
    I am trying to build essbase outline from Essbase studio where my source data is in Parent child format. Dimension hierarchies are not built correctly with this build method.. all members are appearing as siblings... could you please confirm if essbase studio does support Parent Child build method... so that i can try to fix the bugs at source if there are any. Thanks for your help in advance.
    Regards,
    Praveen

    HI John and Glenn,
    Thank you very much for your help. I have now built essbase outline with recursive hierarchies.
    I have total 11 dimensions and 1 fact table. During the cube schema built, chosen fact table column 'Amount' into measures/measure, 11 hierarchies into hierarchy section... and one dimension as "Account" dim from the 11 dims. The data load is failing with the below error:
    Failed to deploy Essbase cube.
    Caused by: Failed to load data into database: CurrrASO.
    Caused by: Cannot get async process state. Essbase Error(1003007): Data Value [8.23326e+007] Encountered Before All Dimensions Selected, [1] Records Completed
    The native sql issued by Studio does not contain the dimension column which is designated as Account dim. I have used custom sql (included one column from each of the 11 dims) but here the data value is also treated as member name and all the records are rejected.
    Member 37356.617844 Not Found In Database
    [2] Mar USD No Segment FY07 Actual-Detail E345 D310 R00 P0000 PL000 7306 37356.617844
    I cant open the rules files in AAS console to check what was going on.. so need your help to understand where i am going wrong.
    Thanks,
    Praveen
    Edited by: user8627339 on Dec 22, 2010 10:26 PM

  • What is the build method to be used in this scenario

    A
    B --- C ---d ----e ---f ---g
    X ---Y---Z
    here A is parent and B,X are childs of A, and C,D,e,f,g, are childs of B, and Y,Z are childs of X then what the build method we must take,when and how do we choose the build methods, is it depending on the hierarchy or what

    Per Glenn's post, you could use a generation load rule against the records for B and X, skipping the first record altogether to come up with the descendants of those two members.
    But that wouldn't get you the relationship of B and X as children of A.
    That's why I wrote you have a mix of dimension build types in your file, or maybe more accurately, an incomplete build file.
    A generation build would look something like:
    A, B, C
    A, B, d
    A, B, e
    A, B, f
    A, B, g
    A, X, y
    A, X, z
    A parent/child build would look like:
    A, B
    B, C
    B, d
    B, e
    B, F
    B, g
    A, X
    X, y
    X, z
    Neither approach matches what you have. Again, I see the parent/child layout most often but maybe that's just me.
    You could play games like first applying a parent/child build rule against your existing layout (with a little tweaking), and then maybe multiple build rules against the file/table for the generation appproach but that seems awfully complicated. Why not just get the source format into a decent format.
    Regards,
    Cameron Lackpour

  • Hi I have a small question about Flash Builder

    Hi,
    I am Chenchu Gottipati, one of the graduate students from Department of Mathematics, Florida Atlantic Univerisity, Boca Raton. I have a small question about Flash Builder student version. I am doing my research in Graph Theory and I am trying to implement some animation of graph using Flash. I was trying to download the software but the link was broken. Could you please help me about how to get around this issie.
    Here is the link provided.
    http://freeriatools.adobe.com/flex
    Regards,
    Chenchu Gottipati

    Thank you for your kind reply. But where can I get this serial number ? I was trying to register through the above link but it was broken. So I don't know how to communicate with Adobe customer service to get the free student version.
    Regards,
    Chenchu Gottipati

  • A question about the getProperty method defined in the Security class

    Hello Everyone!
    I would like to ask a question about the getProperty method defined in the
    Security class.
    public static String getProperty(String key) Do you know how can I exract the list of all possible keys?.
    Thanks in advance,

    I found the answer, in fact the keys are defined in the java.security file.

  • Binary Tree Question

    Ok, I am making a binary tree. I have a question for my insert method. Firstly, I can't find out why the root node is inserted more than once in the tree. Also, I am having trouble with connecting the nodes that I insert to the tree. I can attach modes to root just fine, but I can't find out how to attach nodes to the existing nodes that are already attached to the tree. When I insert a node that meets the criteria of an already existing node, it replaces the node instead of getting attached to it. The answer is probably trivial, but I can't find it. Here is my insert method.
    public void insert(T obj) {
              int _result1;
              int _result2;
           //TODO: Implement Q1 here
              if(isEmpty() == true){
                   _root = createNode(obj, null, null, null);
                   System.out.println("The root inserted is " + _root.element());
                   insert(obj);
              _node = createNode(obj, _root, null, null);
              _result1 = _node.element().compareTo(_root.element());
              if(_result1 < 0){
                        if(_node.isInternal() == true){
                             _current = (BTreeNode<T>) _node2.element();
                             _result2 = _current.element().compareTo(_current.getParent().element());
                             //System.out.println("The current element is " + _current.element());
                             if(_result2 < 0){
                                  _node1.getLeft();
                                  _current = _node1.getLeft();
                             else{
                                  _node1.getRight();
                                  _current = _node1.getRight();
                             if(_node1.hasLeft() == true){
                                  _node1.getLeft();
                                  _current = _node1.getLeft();
                             else{
                                  _current.setLeft(_node1);
                                  _current = _node2;
                        else{
                             _node1 = createNode(obj, _node, null, null);
                             _node.setLeft(_node1);
                             _node1.setParent(_node);
                             System.out.println("The parent of the left node " + _node.element() + " is " + _node.getParent().element());
                             _root.setLeft(_node1);
                             _current = _node1;
                             //System.out.println("The current element is " + _node.element());
              else{
                        if(_node.isInternal() == true){
                             _current = (BTreeNode<T>) _current.element();
                             _result2 = _current.element().compareTo(_current.getParent().element());
                             //System.out.println("The current element is " +_current.element());
                             if(_result2 < 0){
                                  _node1.getLeft();
                                  _current = _node1.getLeft();
                             else{
                                  _node1.getRight();
                                  _current = _node1.getRight();
                             if(_node1.hasRight() == true){
                                  _node1.getRight();
                                  _current = _node1.getRight();
                             else{
                                  _current.setLeft(_node1);
                                  _current = _node1;
                   else{
                        _node1 = createNode(obj, _node, null, null);
                        _node.setRight(_node1);
                        _node1.setParent(_node);
                        //_current = _node1;
                        System.out.println("The parent of the right node " + _node.element() + " is " + _node.getParent().element());
                        _root.setRight(_node1);
                        _current = _node1;                         
                        //System.out.println("The current element is " + _current.element());
              }The output I get is:
    The root inserted is 6
    The parent of the right node 6 is 6
    The parent of the right node 6 is 6 ** I can't figure out why the root is inserted two extra times**
    The parent of the left node 3 is 6
    The parent of the right node 11 is 6
    The parent of the right node 12 is 6 ** this node should be attaching to 11 instead of replacing it **
    The parent of the right node 8 is 6
    The parent of the right node 9 is 6
    The parent of the right node 10 is 6
    The parent of the right node 7 is 6
    preorder :(6 (3 )(7 ))
    postorder:(( 3) ( 7) 6)

    IMO, your insert method is way too complicated.
    Have a look at this pseudo code: that's all it takes to insert nodes in a BT:
    class Tree<T extends Comparable<T>> {
        private Node root;
        public void insert(T obj) {
            'newNode' <- a new Node('obj') instance
            IF 'root' equals null
                let 'root' be the 'newNode'
            ELSE
                insert('root', 'newNode')
            END IF
        public void insert(Node parent, Node newNode) {
            IF 'parent' is less than 'newNode'
                IF the left child of 'parent' is null
                    let 'newNode' be the left child of 'parent'
                ELSE
                    make a recursive call here: insert('???', 'newNode')
                END IF
            ELSE
                IF the right child of 'parent' is null
                    let 'newNode' be the right child of 'parent'
                ELSE
                    make a recursive call here: insert('???', 'newNode')
                END IF
            END IF
    }

  • I can not create an Installer, After install the Vision Builder Demo and then uninstall it. I can not create a Labview installer anymore, it asks me for a Vision Builder Installer, even if My Labview program does not have nothing to do with it...

    I can not create an Installer on LabView, After install the Vision Builder Demo and then uninstall it. I can not create a Labview installer anymore, it asks me for a Vision Builder Installer, even if My Labview program does not have nothing to do with it...
    Solved!
    Go to Solution.

     Hi Shada this can happen if you are including additional installers to your installer for example DAQmx. When you are doing this the installer has to include other files like MAX (Measuremente and Automation Explorer). Probably when you installed Vision Builder it updated MAX, so when your installer is trying to Include MAX, its asking for the source where it was installed in your computer in this case Vision Builder.
     Here you can cache the information so its not asked again, or you can download a newer version fo DAQmx, so it will update MAX and change de dependecy.
     You can find more details about this issue in this KB:
    KnowledgeBase 3S88PJMY: Why Do I Get A "Missing Distribution" Error When Trying to Build an Installe...
    And for keeping a copy here is more info:
     How Do I Stop the Missing Distribution Notification Each Time I Build An Installer?
    Best Regards
    Benjamin C
    Senior Systems Engineer // CLA // CLED // CTD

  • Binary Tree search and print methods

    Hello, I'm trying to create a binary tree from inputs of a user. I believe I have the tree set up right because it shows no errors, but I'm getting an error message with a line of code. I cannot figure out what I am doing wrong. Also, I need to create a print method, which prints the tree's entries and a search method which would search the tree for certain record.
    public class TreeNode 
          public static String empName = null;
          public static int empNumber;
          public static String nextRec = null;
              TreeNode left;
          String Name;
          int Number;
          TreeNode right;
          public static void main(String[] args)
             VRead in = new VRead();
             VWrite out = new VWrite();
             System.out.println("Enter Choice: ");
             System.out.println("A: Enter Employee Information.");
             System.out.println("B: Search For Employee.");
             System.out.println("C: Print Entire Tree.");
             System.out.println("D: Exit.");
             System.out.println("_______________________________");
             char command = in.readChar();
             System.out.println();
             switch (command)
                case 'A':
                case 'a':
                   inputInfo(in, out);           
                   break;
                case 'B':
                case 'b':
                   break;
                case 'C':
                case 'c':
                   break;
                case 'D':
                case 'd':
                   System.exit(0);
                   break;
          public static void inputInfo(VRead in, VWrite out)
             out.write("Enter Employee Name: ");
             empName = in.readString();
             out.write("Enter Employee Number: ");
             empNumber = in.readInt();
             System.out.println();
             System.out.println();
             System.out.println("Enter Choice: ");
             System.out.println("A: Enter Employee Information.");
             System.out.println("B: Search For Employee.");
             System.out.println("C: Print Entire Tree.");
             System.out.println("D: Exit.");
             System.out.println("_______________________________");
             char command = in.readChar();
             System.out.println();
             switch (command)
                case 'A':
                case 'a':
                   inputInfo(in, out);           
                   break;
                case 'B':
                case 'b':
                   break;
                case 'C':
                case 'c':
                             break;
                case 'D':
                case 'd':
                   System.exit(0);
                   break;
          public TreeNode(String empName, int empNumber)
             Name = empName;
             Number = empNumber;
             left = null;
             right = null;
          public class Tree
             TreeNode Root;
             public void Tree(String RootNode)   
        // Errors come from next line
                  Root = new TreeNode(RootNode, Name, Number);   
             public void Insert(String Name, int Number)
                InsertNode(Root, Name, Number);
             public void InsertNode(TreeNode t, String empName, int empNumber)
                if (t == null)
                   t = new TreeNode(empName, empNumber);
                else
                   if (empName.compareTo(t.Name) < 0)
                      InsertNode(t.left, empName, empNumber);
                   else if (empName.compareTo(t.Name) > 0)
                      InsertNode(t.right, empName, empNumber);
                   else if (empName.compareTo(t.Name) == 0)
                      System.out.println("Entered node that was already in Tree");
       }im sure its something simple, i seem to always look over the small stuff. But i could really use some help on the print and search method too

    Just having a quick look over it, and it looks like you are trying to add an extra argument in the TreeNode() method (unless there is a bit of overloading and there is a second treenode method in there) As it is TreeNode only accepts two argumets you have 3
    As for printing the tree you would need to flatten it, that is an in order traversal of the tree.
    FWIW
    I just finished a project at uni that involved at frist writing a BST and then an AVL tree. the full point of these things seems to be to keep students awake at night*
    *Before anyone flames, it's a joke
    G

  • Building a binary tree from a string

    I'm having trouble building a binary tree with shape described in a string.
    00 - means both left and right subtrees are empty;
    01 - means that the left is empty, and the right is not;
    10 - right is empty, left is not
    11 - neither are empty
    public BinaryTree(String s, Iterator it) {
    This constructor is supposed to build the binary tree of the specified shape and fills it with values. THe values come from Iterator it, and are placed into the tree in preorder fashion.
    I have to complete this constructor but I don't really know what to do. I was thinking I could use indexOf somehow. Any help would be greatly appreciated.
    Thanks,
    Mike

    I'd build it like this (this is from the top of my head, so no typo-free-warranties etc.) -- public class Tree {
       private Object data;
       private Tree left= null;
       private Tree right= null;
       private Tree(StringReader sr, Iterator di) {
          char l= (char)sr.read(); // left and right subtree indicators
          char r= (char)sr.read();
          data= di.next(); // set data for this node
          if (l == '1') left= new Tree(sr, di); // build left subtree
          if (r == '1') right= new Tree(sr, di); // build right subtree
       public Tree(String s, Iterator di) {
          this(new StringReader(s), di);
    } Note that the private constructor (the one that does all the work) doesn't handle incorrect strings
    at all, i.e. it'll crash horribly when the string passes contains, say an odd number of characters
    is is simply passing incorrect construction information. Also note that the Iterator must be able
    to iterate over enough elements to be set.
    kind regards,
    Jos

  • Why do we use cl_gui_cfw= flush method in Object Oriented ALV programming

    Dear Friends,
    Please solve my query regarding control framework. Why do we use cl_gui_cfw=>flush method in Object Oriented ALV programming. I studied and found that this method transfers automation queue to Front end.  But I could not find any further update on this.
    Thanks & Regards
    Amit Sharma

    Generally this is to restrict the traffic b/w frontend and backend. This means that every operation in Control Framework should be first buffered in the backend and synchronized with the frontend at certain points (one of this point is calling synchronization method cl_gui_cfw=>flush ). This explicit order of synchronization is due to RFC call needed for every communication b/w front/back end. So to avoid to many RFC calls we do it only at certain time.
    Please refer [Automation Queue|http://help.sap.com/saphelp_wp/helpdata/en/9b/d080ba9fc111d2bd68080009b4534c/frameset.htm]. I think it explains the concept quite well.
    Regards
    Marcin

  • Question:  Do I need to run and anti virus program with MAC OSX Lion? Have heard different opinions! If so what would you recommend? Was looking at Sophos. Does anyone have any experience with this? Thanks

    Question:  Do I need to run and anti virus program with MAC OSX Lion? Have heard different opinions! If so what would you recommend? Was looking at Sophos. Does anyone have any experience with this? Thanks

    Do I need to run and anti virus program with MAC OSX Lion? Have heard different opinions!
    You will continue to hear different opinions here, where thoughts range everywhere between "anti-virus software is the evil spawn of Satan" to "anyone not running anti-virus software is a fool."
    Truth is, this is still a very personal decision on a Mac. Depending on circumstances, it is still very easily possible to stay safe without using anti-virus software, but circumstances and personal preferences vary widely. Besides which, anti-virus software cannot even remotely provide you a guarantee of protection!
    To learn how to stay safe (with or without anti-virus software), and how to decide whether to use anti-virus software, see my Mac Malware Guide.

  • Writting Methods of Binary Tree

    I am using java code to write some binary tree methods.
    Got stuck in some of the following methods.
    Hopefully i can get some help here.
    Public int width(){
    // Return the maximun number of nodes in each level
    Public boolean checkIsFullTree(){
    // Return true if the tree is a full tree (If all leaves are at the same depth then the tree is full)
    Public boolean checkIsCompleteTree(){
    // Return true if the tree is a full tree (If all leaves are at the same depth then the tree is full and is filled from left to right)
    at last
    Public int internalPathLength(){
    // Return The sum of all internal nodes of the paths from the root of an extended binary tree to each node.
    other words, the sum of all depths of nodes.
    Looking forawad to see some replies. Chrees

    I have came up with some ideas.
    Public boolean checkIsFullTree(TreeNode t, int currentHeight ) {
    int maxHeight = height(); // Maximum height.
    int currentHeight=currentHeight;
    if (t == null){
    return false;
    if (t.left() ! = null){
    currentHeight++;
    checkIsFullTree(t.left(), currentHeight);
    if (t.right() ! = null){
    currentHeight++;
    checkIsFullTree(t.right(), currentHeight);
    if ( t.left() == null && t.right() == null){
    if (currentHeight == maxHeight) {
    check = true;
    }else{
    check = false;
    But i am missing sometime here i guess.
    }

Maybe you are looking for

  • IPhone 3G no longer vibrates... HELP!

    As the title suggests, my iPhone doesn't seem to be vibrating anymore at all. I've tried changing various settings, switching the vibrate switch on and off, restarting the phone, doing a hard reset (by holding down the home and standby buttons at the

  • 3TB Time Capsule Disk Error

    Just bought a new 3TB 4th Gen Time Capsule.  Have managed to get the wireless network up but cannot find the disk for time machine back up.  It comes up with an disk error message. Am I missing something or is the Disk damaged?  I thought is was supp

  • OIM 11g R1. Issue with parallel participant type approval workflow.

    Hi All, I have a request level approval with the human task assignment participant type set to parallel. There will be two participants in the workflow with approve and reject having outcome value as 50 each. When i submit a request, i can see the bo

  • Creating Asynchronus webservice in jdev??

    Does any one have complete example of creating async web service???

  • Cannot drag iMovie clips to Timeline!

    I imported some movies from my camcorder and when I try to drag them from the clip viewer, they just ghost out and won't move. I have worked successfully with this same camcorder and iMovie for many months. The only difference is these are longer cli