577 views

1 Answer

0 votes
0 votes

Try to solve taking a list having loop in the list otherwise it will give true whether it is even or odd no of nodes in the list.
Now It will return false when loop is detected because pointer B runs twice fast than pointer A. So after sometime pointer A will catch pointer B and B!=A become faulty and return false because there is B==null condition always faulty.Since there is loop in the list then B can't have null.
 


 

Related questions

1 votes
1 votes
2 answers
1
Rajnish Kumar asked Jul 14, 2015
552 views
#define square(x) x*xmain(){int i;i=64/square(4);printf("%d",i);}
0 votes
0 votes
1 answer
2
0 votes
0 votes
1 answer
3
Don't you worry asked Jul 15, 2016
560 views
why the o/p of this programm is 12 ?#include<stdio.h>int main(){int x = 10;int y = (x++, ++x);printf("%d", y);getchar();return 0;}
1 votes
1 votes
1 answer
4
anonymous asked Aug 14, 2016
533 views
int main() { char *p = "Good"; char a[] = "Good"; printf("%d\t%d\t%s\n", sizeof(p), sizeof(*p)); }According to me ans shld be 2,1but on running o/p is 8,1. How 8 is the o...