2017-01-13 Final Project Update

posted Jan 13, 2017, 7:13 AM by Samuel Konstantinovich   [ updated Jan 13, 2017, 7:15 AM ]
Update: Final Project Readme file MUST include:
-Brief description of your project
-List of Working features / Things I should test
-List of unresolved bugs
-Directions on how to compile and run your code 
-Directions on how to use your program
(Please format the document to look reasonably clear)


Do Now:

/**for each function decide:
   What is the runtime in terms of n?*/
  public static int foo1(int n){
    int x = 0;
    for(int i = 0; i < n/2; i++){
      for(int j = 0; j < n/2; j++){
        x += i*j;
      }
    }
    return x;
  }
  
  public static int foo2(int n){
    int x = 0;
    for(int i = 0; i < n; i++){
      for(int j = 1; j < n; j*=2){
        x += i*j;//doesn't matter
      }
    }
    return x;
  }
  
  public static int foo3(int n){
    int x = 0;
    for(int i = 0; i < n; i+=3){
      for(int j = 0; j < n; j++){
        for(int k = 0; k < j; k++){
          x+= i+j+k;//doesn't matter
        }
      }
    }
    return x;
  }
Comments