python - What is the Big-O performance of this algorithm and how do I solve this normally? -


hello have algorithm having trouble finding performance.

 i=math.ceil(n**0.5)  while n % != 0:    -= 2 

would o(2^n)?

i don't know trying do, current code run give error cannot divide zero many cases example n=13, if i-=1 in place of i-=2 code work fine without error every n , complexity o(n^(1\2)).


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -