Question

Problem 1. Select the running time of each function. void print_array (int* A, int n) for (int í 0; i < n; ++i) cout << A[i] << endl; void print_array pairs (int* A, int n) for (inti 0; i < n; ++i) for (int j 0; j < n; ++j) cout << Ai] ALj]< endl; void print_array_start(int* A, int n) for (int i 0; i < 100 ; ++i) cout << A[i] << endl; void print_array_alt (int* A, int n) for (int i0; i < n; ++i) cout << A[i] << endl;
media%2Fbac%2Fbac90288-8edb-4050-9912-90
0 0
Add a comment Improve this question Transcribed image text
Answer #1
1)  O(n)
2)  O(n^2)
3)  O(1)
4)  O(n)
5)  O(n)
6)  O(n)
7)  O(n)
8)  O(n^2)

\;\;

Add a comment
Know the answer?
Add Answer to:
Problem 1. Select the running time of each function. void print_array (int* A, int n) for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT