how to check whether a linked list is circular.
Answer Posted / priya
This is the function to check if the linklist is circular:
bool CLinklist::ifcircular()
{
node *ptr1,*ptr2;
ptr1 = front;
ptr2 = front;
while(ptr1)
{
ptr1 = ptr1->link;
ptr2 = ptr2->link;
if(ptr2)
ptr2 = ptr2->link;
if(ptr1 == ptr2)
return 1;
}
}
Is This Answer Correct ? | 15 Yes | 7 No |
Post New Answer View All Answers
#include
How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.
Develop a routine to reflect an object about an arbitrarily selected plane
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
Write a routine to implement the polymarker function
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
Design an implement of the inputs functions for event mode
How can you relate the function with the structure? Explain with an appropriate example.
How to palindrom string in c language?
Sir... please give some important coding questions asked by product companies..
write a program for area of circumference of shapes
write a simple calculator c program to perform addition, subtraction, mul and div.
What is data _null_? ,Explain with code when u need to use it in data step programming ?