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 10603Find 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 23363Post New CTS C++ Code Interview Questions
How ways to controlling a play in process?
An i m attending dell company interview bt i m rejected in tat last manager round.....they will asked our company h.r u come tis interview after 3 months my 3 months period is over so i should attend for this company interview again...how will get my job pls help me....
our kks tagging is crossing more than 12 character please suggest how to take tags in the DCS
how we calculate the short circuit capacity of the busbar in LV & HT?
What is Agile Methodology
How are non-atomic and atomic properties different? Which one is the default property for synthesized properties? When would a user operate one over the other?
What are threads and processes?
How jsp is compiled?
any 1 having notes on SAP-ABAP certification, or even if any 1 could provide the url for getting notes on SAP-ABAP certification, would be appreciated.
What is the use of @qualifier annotation?
Mention what is the t-code for changing production order and to display production order?
What is an on”*-input filed” statement?
what is risk?
For high voltage applications will you prefer mosfet or igbt?
Explain how to parse a datetime string?