1

How do you count the number of elements in the circular linked list?

Correct Answer: public int length(node head) { int length = 0; if( head == null) return 0; node temp = head.getnext(); while(temp != head) { temp = temp.getnext(); length++; } return length; }

Make the most of this question

This page focuses on one Data Structure (DS) question from Engineering. After checking the answer, return to the topic list to practice more or run a timed set.

Data Structure (DS) MCQ: How do you count the number of elements in the circular linked list? | Extra Education