Best search algorithm to find condition within a range

jonas.thornvall at gmail.com jonas.thornvall at gmail.com
Wed Apr 8 03:28:09 EDT 2015


Den onsdag 8 april 2015 kl. 09:16:24 UTC+2 skrev Ian:
> On Tue, Apr 7, 2015 at 4:35 PM,  <jonas.thornvall at gmail.com> wrote:
> > I am not sure you guys realised, that althoug the size of the factors to muliply expands according to base^(exp+1) for each digitplace the number of comparissons needed to reach the digit place (multiple of base^exp+1) is constant with my approach/method.
> 
> No it isn't. You do one comparison on every iteration of your while
> loop, and you do one iteration for every digit. How is that constant?

Ok the number of comparissons is linear for each digitplace not exponential.



More information about the Python-list mailing list