[algogeeks] Re: Linked List question

2013-01-04 Thread Don
I did. I'm just having fun with the sloppy problem statement. If you don't ask for what you want you might get what you ask for rather than what you had in mind. The solver might decide that the OP really meant something different, and solve some other problem, which may or may not be what was

[algogeeks] Re: perfect square condition checking....

2013-01-04 Thread Don
First look at the last digit. If it is 2,3,7, or 8 the number is not a perfect square. Then use an integer formulation of Newton's method. For input value x, start with a guess y. If you can arrange for y to be about half the number of digits in x, that is good. Then repeatedly set y=(y*y+x)/(2*y)