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)
In the first case, t*n = 1e6
While in the second and the third cases, t*n = 1e5, which is 10 times faster than the first case
my bad, if t*n is constant, would my runtime differ for different values of t and n?
No, because it runs O(t*n) and t*n is constant.
Auto comment: topic has been updated by tanmaytaneja2 (previous revision, new revision, compare).