Do all ten problems.
| Problem | You got | Out of |
|---|---|---|
| 1 | 10 | |
| 2 | 10 | |
| 3 | 10 | |
| 4 | 10 | |
| 5 | 10 | |
| 6 | 10 | |
| 7 | 10 | |
| 8 | 10 | |
| 9 | 10 | |
| 10 | 10 | |
| TOTAL | 100 |
for (var i = 1; i * i <= n; i++) { for (var j = 1; j <= n; j += j) { IO.println("*"); } }
Write this function tail-recursively.def c(n): return 0 if n==1 else c(n/2 if n%2==0 else 3*n+1)+1
is_prime or isPrime that
returns a boolean value indicating whether its argument is prime or not. Then
answer whether there are any disadvantages to using this function. Okay there
is a huge one. What is it? Answer using technical language and back it up with
real numbers.