Re: A Simple C Code to Discuss



ethanmys wrote
(in article
<1130700706.708360.299740@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>):

> your code is clear. but i think it will cost O(n^2). what i think is:
> there shoud be a O(1) solution to this problem ( don't consider the
> input ).

Sure, a pre-computed lookup table. :-)


--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw





.