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 10669Find 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 23481Post New CTS C++ Code Interview Questions
How can you expand the performance of Talend job which has a complex design?
How many earths can fit into jupiter s great red spot?
What is the wildcard character in sql?
what is the difference between elcb and rccb ?
At os level how you can change the number of work process? How you can analyze the status of work process at os level?
What is "Hungarian Notation"?
What is the web service protocol stack?
Tell me what are the features involved in updating a language?
Explain the default scope of variables in perl?
Can I use a named pipe to bcp/dump data out or in in sybase?
What is the terminals definition and function....?
What is the maximum amount to issue Form C to a dealer for the purchase of 40 crores in several bills in a quater?
Explain what do you know about blackberry 7?
what is the difference between order by and sort by in Hive?
How do you compare the structure of 2 tables in database and check whether they are similar using qtp.