equal
  deleted
  inserted
  replaced
  
    
    
     1 // Part 1 about the 3n+1 conjecture  | 
     1 // Basic Part about the 3n+1 conjecture  | 
     2 //=================================  | 
     2 //======================================  | 
     3   | 
     3   | 
     4   | 
     4   | 
     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.  | 
    10 //    arguments in the range of 1 to 1 Million.  | 
    10 //    arguments in the range of 1 to 1 Million.  | 
    11   | 
    11   | 
    12 //def collatz(n: Long) : Long = ...  | 
    12 //def collatz(n: Long) : Long = ...  | 
    13   | 
    13   | 
    14   | 
    14   | 
    15 //(2)  Complete the collatz_max function below. It should  | 
    15 //(2) Complete the collatz_max function below. It should  | 
    16 //     calculate how many steps are needed for each number   | 
    16 //    calculate how many steps are needed for each number   | 
    17 //     from 1 up to a bound and then calculate the maximum number of  | 
    17 //    from 1 up to a bound and then calculate the maximum number of  | 
    18 //     steps and the corresponding number that needs that many   | 
    18 //    steps and the corresponding number that needs that many   | 
    19 //     steps. Again, you should expect bounds in the range of 1  | 
    19 //    steps. Again, you should expect bounds in the range of 1  | 
    20 //     up to 1 Million. The first component of the pair is  | 
    20 //    up to 1 Million. The first component of the pair is  | 
    21 //     the maximum number of steps and the second is the   | 
    21 //    the maximum number of steps and the second is the   | 
    22 //     corresponding number.  | 
    22 //    corresponding number.  | 
    23   | 
    23   | 
    24 //def collatz_max(bnd: Long) : (Long, Long) = ...  | 
    24 //def collatz_max(bnd: Long) : (Long, Long) = ...  | 
    25   | 
    25   | 
    26   | 
    26   | 
    27   | 
    27   |