go to previous page   go to home page   go to next page

Answer:

No. You don't always know how long the sequence will be for a particular starting value.


Method

hail stones

Here is the definition, again:

And here is a method:

  public static void hail( long N )
  {
    System.out.print( N + ", ");
    
    if (  )
      return;
      
    else if (  )
    
      hail(  );
      
    else
      hail(  );
  }

The method prints out the current N, then advances to the next N by calling itself. When N hits one, it returns to its caller, which returns to its caller, and so on up the chain until the first activation.


QUESTION 15:

Fill in the blanks.


go to previous page   go to home page   go to next page