Question 1
 A You cannot have the 'next' pointer point to null in a circular linked list B It is faster to traverse the circular linked list C You may or may not have the 'next' pointer point to null in a circular linked list D All of the mentioned
Question 1 Explanation:
The 'next' pointer points to null only when the list is empty, otherwise it points to the head of the list.

 Question 2
How do you count the number of elements in the circular linked list?
 A public int length(Node head) { int length = 0; if( head == null) return 0; Node temp = head.getNext(); while(temp  B public int length(Node head) { int length = 0; if( head == null) return 0; Node temp = head.getNext(); while(temp  C public int length(Node head) { int length = 0; if( head == null) return 0; Node temp = head.getNext(); while(temp  D None of the mentioned
Question 2 Explanation:
If the head is null, it means that the list is empty. Otherwise, traverse the list until the head of the list is reached.

 Question 3
What is the functionality of the following piece of code? Select the most appropriate

public void function(int data) { 	int flag = 0; 	if( head != null) 	{ 		Node temp = head.getNext(); 		while((temp != head) && (!(temp.getItem() == data))) 		{ 			temp = temp.getNext(); 			flag = 1; 			break; 		} 	} 	if(flag) 		System.out.println("success"); 	else 		System.out.println("fail"); }
 A Print success if a particular element is not found B Print fail if a particular element is not found C Print success if a particular element is equal to 1 D Print fail if the list is empty
Question 3 Explanation:
The function prints fail if the given element is not found. Note that this option is inclusive of option d, the list being empty is one of the cases covered.

 Question 4
What is the time complexity of searching for an element in a circular linked list?
 A O(n) B O(nlogn) C O(1) D None of the mentioned