Re: sqrt (was Re: A89: TI-GCC)
[Prev][Next][Index][Thread]
Re: sqrt (was Re: A89: TI-GCC)
Once again, my algorithm is shot down. But constructive criticism is always
welcome. . . more below:
> The algorithm works, but it's slower. A rough time complexity analysis
> reveals that your algorithm is O(sqrt(n)), while the other algorithm is
> O(log n) (or O(1) if you prefer).
How is this determined? What exactly is that notation?
> the algorithm below (modified
> to the new integer size of course) returned the answer "instantly", while
> your algorithm (also modified of course) never returned an answer at
all...
> (It would, eventually, but I didn't want to spend the whole night waiting
> for it... :) )
LOL - figures. Wouldn't think it would be THAT long, though. . .
Could you elaborate on how that O(log n) algorithm works? I don't quite
understand it, and working through it is "confusing" at the least.
-Scott