Tell How To Check Whether A Linked List Is Circular ?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a pointer how and when is it used?

580


How to run C++ program in cmd

375


Mention the purpose of istream class?

623


What is an incomplete type in c++?

770


What are the various types of stl containers?

738






What do you mean by enumerated data type?

578


How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?

636


What is c++ try block?

585


What is &x in c++?

558


Can circle be called an ellipse?

638


What is difference between rand () and srand ()?

596


Is string data type in c++?

586


Are iterators pointers?

681


What is a virtual function in C++?

591


Describe the process of creation and destruction of a derived class object?

643