How do I find the space and time complexities for this code

后端 未结 0 1040
不思量自难忘°
不思量自难忘° 2020-12-19 03:27
fun root(n) =
if n>0 then
let
  val x = root(n div 4);
in
  if (2*x+1)*(2*x+1) > n then 2*x
  else 2*x+1
end
else 0;

fun isPrime(n,c) =
if c<=root(n) then
         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题