Question: Use the following C++ code and answer the questions below. Write down the outputs of all cout when the CPP program is executed? What is

Use the following C++ code and answer the questions below.

Use the following C++ code and answer the questions below. Write down

  1. Write down the outputs of all cout when the CPP program is executed?
  2. What is the Big O of line 7 - 20? Do not count Big O of the for loop from line 16 - 18 in this answer. ________________________________________________________

1 #include 2 using namespace std; 4 int main() { int a []4, 6, 2, 8) int size sizeof (a sizeof (a[e]); 6 7 8 9 10 1 12 13 24 15 16 17 18 19 20 21 for (int 1-0; 1 size; i++) { if(i a[j-1]) { int tempa[j]; a[j] a[j-1]; a[j-1] = temp ; for (int 0; 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!