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 8944Find 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 21568Post New CTS C++ Code Interview Questions
How to create a document that will appear on a pal d1 widescreen television broadcasting?
Why are recursive relationships are bad? How do you resolve them?
What is lazy loading in c#?
What are the different types of variables in obiee 11g? Explain
What is bluetooth - a technology, a standard, an initiative, or a product?
explain the methods of measuring aproblem of armature reactionof DC machine?
How do you remove a border in word 2010?
need to join coaching institute in coimbatore tamilnadu ......say me the best coaching for IAS
What is the output of the below program?
What is the maximum number of cards that can be passed to the map?
Why are steel plates inserted inside bearings in elastomeric bearing?
What is a crosstab query?
What are the data pins of microprocessors? What is their use?
How to create percentile function?
What are the technologies a java developer must know?