Examveda

What is the functionality of the following code?
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++;
}

A. Inserting a node at the beginning of the list

B. Deleting a node at the beginning of the list

C. Inserting a node at the end of the list

D. Deleting a node at the end of the list

Answer: Option C


This Question Belongs to Data Structure >> Introduction To Data Structures

Join The Discussion

Related Questions on Introduction to Data Structures