title: Find the length of the longest increasing subsequence using only one auxiliary recursion function
body: <p>I need to find the length of the longest monotonically increasing subsequence using only a single recursion function.
  For example given an <code>arr={45 1 21 3 33 6 53 9 18}</code> it need to give back 5. I have started to write the code but i'm stuck, and i don't know how to find out which of the calls gives the maximum length.</p>
  
  <p>The function <code>longestSet</code> is my auxiliary function i can use any variables i want but it have to be called from the function <code>max_set</code>.</p>
  
  <pre><code>void question3(int question)
  {
      int *arr, size;
      printf("enter the array size\n");
      scanf("%d", &amp;size);
      arr=(int*)malloc(size*sizeof(int));
      fillArr(arr, size-1);
      max_set(arr, size);
      free(arr);
  }
  
  void max_set(int arr[], int size)
  {
      int i=0, finelmax=0, count=0,longrising;
      longrising=longestSet(arr,size,i,finelmax,count);
      printf("the length of the longest risind set is: %d", longrising);
  }
  
  int longestSet(int arr[], int size, int i, int finelmax, int count)
  {
      if(i==size)
          return count;
  
      if(arr[i]&gt;=finelmax)
      {
          finelmax=arr[i];
          return longestSet(arr,size,i+1,finelmax,count+1);
      }
  
      return longestSet(arr,size,i+1,finelmax,count);
  }
  </code></pre>