initialization processes in lines 4-6 have complexity $O(t * n)$. The statements in lines 7-11 execute a total of (t * n). Thus, the complexity is O(t * n), where t is the number of features and n is the number of documents in the dataset. The same complexity O(t * n) is for the double for-loop in lines 12-20. Finally, there is an O(t) at worst for calculating the length of the new dimension in lines 22-27. The total time is O(t * n + t * n + t * n + t), where the total algorithm complexity is of the order O(n * t) + t.