Runtime Doubt

Revision en3, by tanmaytaneja2, 2022-08-05 00:30:25

Very basic doubt but I had to ask :

Say TC == O(n*t); Would their be any significant differences in runtime of (t=10, n=10000), (t=1000, n=100) and (t=10000, n=10)? If yes, why? I tried searching for the answer on the web but I couldn't find a solution which satisfied me.

say code : ~~~~~ int t; cin>>t; while(t--){ int n; cin>>n; for(int i=0; i<4; i++){ for(int j=0; j<n; j++){ // whatever; } } } ~~~~~

(Not talking about the general runtime difference when running the same code multiple times due to processor)

Tags runtime, time complexity


  Rev. Lang. By When Δ Comment
en3 English tanmaytaneja2 2022-08-05 00:30:25 0 (published)
en2 English tanmaytaneja2 2022-08-05 00:29:44 3 I had quoted the different (t, n) wrongly earlier. Basically my point being whether if the product of T*N is the same, would my runtime change for different values of T and N? (T*N = constant) (saved to drafts)
en1 English tanmaytaneja2 2022-08-04 05:26:25 607 Initial revision (published)