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
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
Sir... please give some important coding questions asked by product companies..
What is full form of PEPSI
Cluster head selection in Wireless Sensor Network using C programming language.
can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail
How to palindrom string in c language?
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql
why nlogn is the lower limit of any sort algorithm?
how to test pierrot divisor
Write a program to model an exploding firecracker in the xy plane using a particle system
why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
What is data _null_? ,Explain with code when u need to use it in data step programming ?
#include
Write a routine to implement the polymarker function