progs/collatz.scala
changeset 24 66b97f9a40f8
parent 18 87e55eb309ed
child 37 38f3868891f0
equal deleted inserted replaced
23:8ac886bb0c15 24:66b97f9a40f8
     5 //(1) Complete the collatz function below. It should
     5 //(1) Complete the collatz function below. It should
     6 //    recursively calculate the number of steps needed 
     6 //    recursively calculate the number of steps needed 
     7 //    until the collatz series reaches the number 1.
     7 //    until the collatz series reaches the number 1.
     8 //    If needed you can use an auxilary function that
     8 //    If needed you can use an auxilary function that
     9 //    performs the recursion. The function should expect
     9 //    performs the recursion. The function should expect
    10 //    arguments in the range of 1 to 10 Million.
    10 //    arguments in the range of 1 to 1 Million.
    11 
    11 
    12 def collatz(n: Long): ... = ...
    12 def collatz(n: Long): ... = ...
    13 
    13 
    14 
    14 
    15 //(2)  Complete the collatz bound function below. It should
    15 //(2)  Complete the collatz bound function below. It should