[A83] Re: Pythagorean's theorem


[Prev][Next][Index][Thread]

[A83] Re: Pythagorean's theorem



robvanwijk@gmx.net writes:
> Why not perform a binary search (look halfway, see if that value is
> larger or smaller, ...)? Seems like that would be a lot faster.

A binary search would be a lot faster in many cases.  I chose to describe
the algorithm using the simpler linear search.  Though for a small table, a
linear search might be faster.  A binary search has more overhead.

The problem with comparing an O(n) algorithm with O(log n) is that it says
nothing about the cost of n.

-- 
David Phillips <david@acz.org>
http://david.acz.org/




Follow-Ups: References: