What is the most efficient way to fix the time complexity of an algorithm? |
I have looked through Google and resource for a clear and straightforward explanation of how to calculate time complexity, but I have yet to find one.
What information do I already have? The following code is: Code: char h = 'y'; // This will be executed 1 time The following loop is like the one below: Code: for (int i = 0; i < N; i++) {
I am familiar with the basics of time complexity calculations but have seen complexity measured in terms of O(N), O(n^2), O(log n), O(n!), and other forms. |
Welcome Guest, Not a member yet? Register Sign In |