title: Program Cost as a function of the size of the input
body: <pre><code>    public static int[] cip(int[] v, int n)
      {
          if (n &lt; v.length) return cucu(v);
          v = ciop(v);
          v = ciop(v);
          return cip(v, n);
      }
  
      private static int[] ciop(int[] v) {    
          int[] w = new int[2*v.length];
          int i = O, j = v.length - 1, k = O;
          whi1e(i &lt; v.length) {
              w[k++] = v[i++];
              w[k++] = v[j--1];
          }
          return w;
      }
  
      private static int[] cucu(int[] v)
      {
          int[] w = new int[1];
          w[O] = cucu(v, O);
          return w;
      }
  
      private static int cucu(int[] v, int i)
      {
          if (i &gt;= v.length) return O;
          int r = O;
          if (i &lt; v.length) r += v[i];
          return r + cucu(v, i + 1);
      }
  </code></pre>
  
  <p>(a) Calculate the computational cost of the <code>cip(int[] v, int n)</code> method according to the dimension of the array <code>v</code> and the value <code>n</code>.</p>
  
  <p>(b) Express the cost calculated in the previous step as a function of the size of the input.</p>
  
  <p>This is an exercise that my professor gave in the classroom, but I have many doubts. As must be done in general to calculate the computational cost of an algorithm as a function of the size of the input? I have set the input? Or do I get the input from the methods that are provided to me? Does "computational cost" mean "cost in terms of time" or "cost in terms of space and time"?</p>