Search:

Type: Posts; User: Norm

Search: Search took 0.17 seconds.

  1. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    What is the count? Is it used when debugging the code to keep the output down to a reasonable size?
    Once the bug is fixed the debug count can be commented out of the source.
  2. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    Sounds like an infinite loop. Add some printlns to show where the code is executing and what the values of the variables are as they are used. The print out will show you where the loop is.
  3. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    That long name is for the case where the class is in the package: binary.search.tree

    The full package.classname must be specified with the java command when trying to execute the class.
    The IDE...
  4. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    Use a reference to a node to get to the values in a node. For example: root.value would access value in the instance of Node referred to by toot.
    Node.left is how it would be coded if left was...
  5. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    Did you see this in post#8
    root should be in BST not in Node

    Where is the constructor for the BST class. Hint: constructors don't return void.


    Most of the errors for "cannnot find symbol"...
  6. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    The Node class is passive. It holds the pointers and value.
    BST class has the logic for maintaining the tree and accessing the Node objects for chaining the nodes together and traversing the tree....
  7. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    value should be a local variable in the main() method
    main() should NOT be creating Node objects. That should be done in the BST class's insert() method.

    In post#2 I said:

    Create an instance...
  8. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    The Node class can be an inner class in the BST class or it could be outside the BST class. It would not have to be in a separate file(unless you want it to be public).


    Please post the full...
  9. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    Create an instance of the class in the main() method and call some of its methods.


    It looks like the definitions of the Node class and the BST class are mixed together. The Node class shouldn't...
Results 1 to 9 of 9