What is the time complexity T(n) of the following program? a) int n, d, i, j; cin >> n; for (d=1; d<=n; d++) for (i=1; i<=d; i++) for (j=1; j<=n; j += n/10) cout << d << " " << i << " " << j << endl; b) void main() { int n, s, t; cin >> n; for (s = 1; s <= n/4; s++) {t = s; while (t >= 1) { cout << s << " " << t << endl; t--; } } } c) void main() { int n, r, s, t; cin >> n; for (r = 2; r <= n; r = r * 2) for (s = 1; s <= n/4; s++) { t = s; while (t >= 1) { cout << s << " " << t << endl; t--; } } }
3 10110Find the maximum product of three numbers in an array? Eg. 9,5,1,2,3 Max product= 9*5*3= 135 The array can hav negative numbers also..
7 22871Post New CTS C++ Code Interview Questions
Is datetime a value type in c#?
Is razor a mvc?
What are the applications of graph data structure?
what parameters are should nessary for control technic dc drive(in rolling mills)?
What is the mobile application development all about?
How you can update memcached when data changes?
Explain what is mvc architecture?
What are logical and physical tags in html?
How to disable maintaince mode in laravel?
What is meant by duty-cycle?
How can we make a mashup with java by accessing other domains data?
How does a network topology affect your decision in setting up a network?
Is java an api?
How can you log an error to the server event log from a stored procedure?
Is 64 bit windows better than 32bit?