Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3539


Sir... please give some important coding questions asked by product companies..

2263


What is full form of PEPSI

2422


Cluster head selection in Wireless Sensor Network using C programming language.

3746


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

3004


How to palindrom string in c language?

11101


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2912


why nlogn is the lower limit of any sort algorithm?

2850


how to test pierrot divisor

2764


Write a program to model an exploding firecracker in the xy plane using a particle system

4143


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 ?

2772


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

3361


What is data _null_? ,Explain with code when u need to use it in data step programming ?

3347


#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1638


Write a routine to implement the polymarker function

4905