Tell How To Check Whether A Linked List Is Circular ?



Tell How To Check Whether A Linked List Is Circular ?..

Answer / dhayalan.n

we will store the header node into some other variable, then traverse the list, if we get null at the next part of any node, then that is not circular, otherwise we will check the next node is same as the stored node or not, if so then that is circular

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ Interview Questions

Explain about Searching and sorting algorithms with complexities

1 Answers   Accenture,


Consider the following C++ program

1 Answers  


Tell me about virtual function

2 Answers  


What is Copy Constructor?

5 Answers   ABC, Siemens,


Describe the different styles of function prototypes in C++.

1 Answers   Adobe,


When would you use a pointer? A reference?

1 Answers   Amazon,


What are the costs and benefits of using exceptions?

1 Answers   Amazon,


What is a memory leak in C++?

1 Answers   Agilent,


How to reverse a string in C++

1 Answers  


Explain what happens when an exception is thrown in C++.

1 Answers   Amazon,


What is C++11?

2 Answers   Adobe,


What is the difference between realloc() and free() in C++?

1 Answers   IBS, TCS,


Categories