STEM Wiki
Advertisement

Example Code[]

public void addAtEnd(String s) {
    if (top == null) {
        top = new Node (s, null);
        return;
    }

    Node temp = top;
    while (temp.getNext() != null) {
       temp = temp.getNext();
    }

[1]


External links[]

Wikipedia article on linked list.

Advertisement