Circular Linked Lists Questions and Answers
Circular Linked Lists Questions and Answers
-25%
2. How do you count the number of elements in the circular linked list?
a)
b)
advertisement
https://www.sanfoundry.com/data-structure-questions-answers-circular-linked-lists/ 1/10
28/11/2023, 09:25 Circular Linked Lists Questions and Answers - Sanfoundry
c)
d)
advertisement
https://www.sanfoundry.com/data-structure-questions-answers-circular-linked-lists/ 2/10
28/11/2023, 09:25 Circular Linked Lists Questions and Answers - Sanfoundry
View Answer
3. What is the functionality of the following piece of code? Select the most appropriate.
advertisement
https://www.sanfoundry.com/data-structure-questions-answers-circular-linked-lists/ 3/10
28/11/2023, 09:25 Circular Linked Lists Questions and Answers - Sanfoundry
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) O(n2)
View Answer
6. Choose the code snippet which inserts a node to the head of the list?
a)
https://www.sanfoundry.com/data-structure-questions-answers-circular-linked-lists/ 4/10
28/11/2023, 09:25 Circular Linked Lists Questions and Answers - Sanfoundry
b)
c)
size++;
}
d)
View Answer
7. What is the functionality of the following code? Choose the most appropriate answer.
https://www.sanfoundry.com/data-structure-questions-answers-circular-linked-lists/ 6/10
28/11/2023, 09:25 Circular Linked Lists Questions and Answers - Sanfoundry
d) Returns the data and deletes the node from the beginning of the list
View Answer
8. What is the functionality of the following code? Choose the most appropriate answer.
10. Consider a small circular linked list. How to detect the presence of cycles in this list effectively?
a) Keep one node as head and traverse another temp node till the end to check if its ‘next points to
head
b) Have fast and slow pointers with the fast pointer advancing two nodes at a time and slow pointer
advancing by one node at a time
c) Cannot determine, you have to pre-define if the list contains cycles
https://www.sanfoundry.com/data-structure-questions-answers-circular-linked-lists/ 7/10
28/11/2023, 09:25 Circular Linked Lists Questions and Answers - Sanfoundry
d) Circular linked list itself represents a cycle. So no new cycles cannot be generated
View Answer
To practice all areas of Data Structure, here is complete set of 1000+ Multiple Choice Questions and
Answers.
« Prev - Data Structure Questions and Answers » Next - Data Structure Questions and Answers –
– Doubly Linked List Stack using Array
Related Posts:
advertisement
Recommended Articles:
1. Data Structure Questions and Answers – Doubly Linked List
2. Data Structure Multiple Choice Questions – Linked List
https://www.sanfoundry.com/data-structure-questions-answers-circular-linked-lists/ 8/10
28/11/2023, 09:25 Circular Linked Lists Questions and Answers - Sanfoundry
advertisement
Additional Resources:
Linked List Programs in C
Linked List Programs in Python
Data Structure MCQ Questions
Data Structures in C
Data Structures in Java
Popular Pages:
Data Structures in C++
C Programs on Recursion
C Tutorial
https://www.sanfoundry.com/data-structure-questions-answers-circular-linked-lists/ 9/10
28/11/2023, 09:25 Circular Linked Lists Questions and Answers - Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is
Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on
development of Linux Kernel, SAN Technologies, Advanced C, Data
Structures & Alogrithms. Stay connected with him at LinkedIn.
https://www.sanfoundry.com/data-structure-questions-answers-circular-linked-lists/ 10/10