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 8880Min-Max Write an algorithm that finds both the smallest and largest numbers in a list of n numbers and calculate its complexity T(n).
1 6203write a c program, using for loop, that accepts and odds two numbers. The output must be the sum and the addens. This should be repeated 5 times while the first number is decremented by one and the second number is incremented by 1.
2 8028Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.
5 14883Post New Infosys C++ Code Interview Questions
Can you apply link and association interchangeably?
What is user properties? Why we using the user properties?
What are the different types of action?
Explain how you will login into any site if it is showing any authentication popup for username and password?
Which are the different segments of memory?
What is the reason behind your Low/high C.G.P.A
CLASSIFY THE FOLLOWING INTO REAL,NOMINAL AND PERSONAL- 1.unpaid salaries a/c 2.arvind mills a/c 3.arvind mills shares a/c 4.prepaid rent a/c 5.fire insurance premium a/c 6.life insurance premium a/c 7.petty cash a/c 8.loan given a/c 9.interest received a/c 10.loan received a/c
What is bridging header in ios?
Name the fund management scheme introduced by rbi which helps the banks in their fund management?
How to get started with node.js?
what are the Cs in testing
How many types of table in Oracle?
What is static in java?
State the basic elements of an export sales contract.
What are linked lists good for?