Functionality of the Following code is
public void function(Node node)
{
if(size == 0)
head = node;
else
{
Node temp,cur;
for(cur = head; (temp = cur.getNext())!=null; cur = temp);
cur.setNext(node);
}
size++;
}
- Deleting a node at the beginning of the list
- Deleting a node at the ending of the list
- Inserting a node at the end of the list
- Both A and C
Correct Answer:
Inserting a node at the end of the list
need an explanation for this answer? contact us directly to get an explanation for this answer