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

Write a C++ Program to find Square Root of a number using sqrt() function.

1 Answers  


What does it mean to declare a function or variable as static?

0 Answers   Amazon,


How to delete array of objects in C++? Proof by C++ code for proper deletion

0 Answers  


Identify the error in the following program. #include<iostream.h> void main() { int i = 0; i = i + 1; cout « i « " "; /*comment *//i = i + 1; cout << i; }

1 Answers  


Consider the following C++ program

0 Answers  






Write a program to read the values a, b and c and display x, where x=a/b–c. Test the program for the following values: (a) a = 250, b = 85, c = 25 (b) a = 300, b = 70, c = 70

1 Answers  


What is the purpose of a constructor? Destructor?

0 Answers   Amazon,


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

0 Answers   Adobe,


What are the major differences between C and C++?

0 Answers   Amazon,


Explain about Searching and sorting algorithms with complexities

0 Answers   Accenture,


How can you force the compiler to not generate them?

0 Answers   Amazon,


Briefly explain various access specifiers in C++.

0 Answers   Amdocs,


Categories