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 the latest c++ version?

818


Array base access faster or pointer base access is faster?

2035


What are the differences between new and malloc?

819


Can we inherit constructor in c++?

776


Write a program to find the Factorial of a number

794


What is std :: endl?

783


the maximum length of a character constant can be a) 2 b) 1 c) 8

877


What you know about structures in C++?

802


How to defines the function in c++?

824


What is c++ map?

754


Write about the retrieval of n number of objects during the process of delete[]p?

779


what is c++

2060


Differentiate between the message and method in c++?

806


What is a standard template library (stl)? What are the various types of stl containers?

911


Can c++ do everything c can?

805