Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    14
    Views
    1,431

    [SOLVED] Re: need help implementing LinkedList

    I would add ID Strings to make it clearer:

    return "Node: " +value + " next=" + next;

    The this & toString() are redundant
  2. Replies
    14
    Views
    1,431

    [SOLVED] Re: need help implementing LinkedList

    Did you try adding a Public String toString() {} method to the Node class that returns a String with the value and next values. It allows you to print a node easily for debugging. For example if...
  3. Replies
    14
    Views
    1,431

    [SOLVED] Re: need help implementing LinkedList

    Does it compile and execute?

    For debugging I'd add a toString() method to the Node class that would return the value and next variables. Then you can print a Node and see it all.
  4. Replies
    14
    Views
    1,431

    [SOLVED] Re: need help implementing LinkedList

    Test with code to create an instance of the Node class, compile and execute it.

    To visualize a linked list, take a piece of paper, draw some Nodes with data and next and chain the Nodes together. ...
  5. Replies
    14
    Views
    1,431

    [SOLVED] Re: need help implementing LinkedList

    The Node class has a value and a pointer to the next Node.
    Have you tried creating an instance of the Node class? You should be compiling and testing the code after each small step to check if...
Results 1 to 5 of 5