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 best c++ book?

710


Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

538


What is c++ virtual inheritance?

595


Describe protected access specifiers?

675


what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?

1746






What do the keywords volatile and mean mutable?

603


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1618


when to use 'mutable' keyword and when to use 'const cast' in c++

1642


Is c++ used anymore?

587


Define linked lists with the help of an example.

552


Explain how functions are classified in C++ ?

805


What is multilevel inheritance in oop?

555


i wanted to know about questions about c,c++ , which is required for placements.... im a fresher

1698


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

1503


draw a flowchart that accepts two numbers and checks if the first is divisible by the second.

2858