May be this can work.....give any counter example...
int count;
main()
{
int l,rope,cuts;
scanf("%d%d",&l,&rope);
count =0;
find_cuts(l,rope);
printf("cuts needed is %d",count);
getch();
return 0;
}
int find_cuts(int l,int rope)
{
if(l==rope)
return count;
count++;
printf("%d",count);
l=l/2;
if(l==rope)
return count;
if(rope>l)
rope =rope-l;
find_cuts(l,rope);
}
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.