Search:

Type: Posts; User: Maukkv

Search: Search took 0.12 seconds.

  1. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    I've narrowed it down to the while section in my code I've tried implementing a count system so that it acts while the count is below a certain number.



    public static int count = 1;
    .
    .
    ....
  2. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    When I try to run it in Netbeans, it just seems to run forever, I left it going for over 20 mins and it didn't complete the running process?
  3. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    I've changed my code quite substantially, and now I have seem to have got a working bit of code, however now when I run it in the command window I get the following error which I can't seem to make...
  4. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    I'm not sure how I can solve the problem I now have, I've tried replacing the left and right in the insert method with Node.left/Node.right but I now get an error saying that they can't be referenced...
  5. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    Okay I understand what you're saying, I currently have this code:


    public class BinarySearchTree {


    public static class Node {
    private int value;
    private Node right;
    ...
  6. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    Okay right, I understand that more clearly now. I also see the problem with the node class interfering with insert. However when I define the Node class as an inner class it looks like the fields...
  7. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    That's what I get from the cmd window.
  8. Replies
    17
    Views
    2,968

    Re: Binary Search Tree inorder tree traversal

    I have tried writing this:


    public static void main(final String[] args){
    int[] anArray = { 7, 3, 1, 6, 9, 0, 4, 5, 2, 8};
    value = anArray[0];
    Node firstnode = new...
  9. Replies
    17
    Views
    2,968

    Binary Search Tree inorder tree traversal

    Hi I'm very new to Java and I'm trying to write some code to create a Binary Search Tree with the goal of outputting a list of integers using the inorder tree traversal method.
    I've got as far as...
Results 1 to 9 of 9