Sobes.tech
Junior — Senior

Implementing the node insertion function in a singly linked list

livecode

Task condition

It is necessary to implement the add method, which places the passed value into a singly linked list structure. The value should either be stored in the current node or passed further along the chain of calls.

@Override
public boolean add(T element) {
    this.data = element;
    return data != null;
}