hi guys
im implementing a basic singly linked list structure (Java class) it should allow the addition and deletion of a single (element in the linked list) at a specified position i. we can assume that each element is int.
there is a code (I have couple of similar but this is better than at hers so far)
3)
public class Node{
public int data;
Node next;
public Node getNextNode(Node n){
return n;
}
public Node(int data){
this.setData(data);
}
public Node(int data,Node next){
this.setData(data);
this.next=next;
}
public int getData() {
return data;
}
public void setData(int data) {
this.data = data;
}
this is to create the node, but struggling with where to put the nodes into the array?
any advice
thx