title: What is the time complexity for a nested loop in this case?
body: <p>I'm trying to tokenize a text file. I created a list of lines found in the text file using readlines() and plan to loop through each sentence in that list to split each sentence using re.split(). I then plan to loop through the resulting list to add each word into a dictionary to count how many times each word occurs. Would this implementation of a nested list result in O(N^2) or O(N)? Thanks.</p>
  
  <p>This code is just an example of how I plan to implement it.</p>
  
  <pre><code>    for sentence in list:
          result = re.split(sentence)
          for word in result:
              dictionary[word] += 1
  </code></pre>