title: Write recurrence relation of function
body: <p>I know the formula for the recurrence relation is T(n)=aT(n/b)+f(n). And given that equation I know how to solve for the BigO. My homework question asked me to write a recursive function to count the number of nodes in a list, which I did but then asked me to write a recurrence relation. Here's my code:</p>
  
  <pre><code>int count(ListNode *l)
  {
      if(!l) return 0;
      if(!l-&gt;next) return 1;
  
      return 1 + count(l-&gt;getNext());
  }
  </code></pre>
  
  <p>But I am totally lost on how to create/formulate my own recurrence relation formula...how do I find a or b....I don't know where to begin. How do I write the recurrence relation for this function? Thank you.</p>