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

What are the advantages/disadvantages of using inline and const?

0 Answers   Amazon,


C++ supports multiple inheritance. What is the “diamond problem” that can occur with multiple inheritance? Give an example.

0 Answers  


What is partial specialization or template specialization?

0 Answers   Amazon,


What is a virtual function in C++?

0 Answers   C DAC,


How to invoke a C function using a C++ program?

0 Answers   Alter,






What does it mean to declare a member function as static in C++?

0 Answers   Amazon,


How to input string in C++

0 Answers  


When would you use a pointer? A reference?

0 Answers   Amazon,


What is name mangling/name decoration?

0 Answers   Amazon,


What is the difference between creating an object, using 'new' and using 'malloc'?

3 Answers   HFG, Siemens,


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

0 Answers   Amazon,


What is function overloading and operator overloading in C++?

0 Answers   IBS, TCS,


Categories