Recommended Answers
Jump to PostCount the total number of basic operations, those which take a constant amount of time. That's all there is to it.
For example, the code
int Sum = 0;
is 1 basic operation. Thenj = 0;
is another basic operation. Thenj < i
forms …
Jump to PostVery good work !!! Really well explained
Jump to PostHi
Could you please explain how did you come to the result of 3/2N^2... as i cannot figure that out, and i really want to know how to caluclate the time complexity of a given algorithm. I quite understood it that you have to count the steps invovled in …
Jump to PostWhich step don't you get? Do you understand how I got to [tex](3N + 6) + (3(N-1) + 6) + \cdots + (3(2) + 6) + (3(1) + 6)[/tex]?
Jump to PostWell i understand 3N, and 3(N - 1) , 3(N-2)..... But i did not really understand, 3(2) + 6, 3(1) + 6 etc, as i think this would be result of replacing the N's value {I am not sure though}.
However, the real difficulty is calculating the actual result. 3/2N^2 …
All 23 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.