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 10737Find 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 23606Post New CTS C++ Code Interview Questions
Will android apps work on windows 10?
exactly how does an RTD 3 wire or 4 wire device cancel out the resistance of the wires , opposed to a 2 wire RTD? Is it because you have resistors in parallel , or because something to do with the electronic circuit the RTD is connected to ?
Explain in steps what happens when an interrupt occurs?
Mention what are the different gates where Boolean logic are applicable?
Are there interfaces in c++?
Which built-in method removes the last element from an array and returns that element?
What is a data source or ds? : sql server analysis services, ssas
Which client would you advise to use radius targeting?
Capital secure should be shown in which side of the balance sheet?
Compare cron and anacron in linux with an example?
Is it possible to have a function as a parameter in another function?
What are application partitions? When do we use them?
How do you show a powerpoint?
Why choose a Public sector undertaking (PSU) over a private firm? Aren't they more competitive than us?
What is a modal plugin in bootstrap?