Question: C++ 1. A?B?C?D? which one is correct 2. 3A, 3B #include using namespace std; void swap0(int* ptri, int* ptr2) { int *temp; temp = ptr1;

C++

1. A?B?C?D? which one is correct C++ 1. A?B?C?D? which one is correct 2. 3A, 3B #include using

2.

namespace std; void swap0(int* ptri, int* ptr2) { int *temp; temp =

3A, 3B

ptr1; ptr1 = ptr2; ptr2 = temp; void swap1(int ptri, int ptr2){int temp; temp = ptri; ptr1 = ptr2; ptr2 = temp; portion

#include using namespace std; void swap0(int* ptri, int* ptr2) { int *temp; temp = ptr1; ptr1 = ptr2; ptr2 = temp; void swap1(int ptri, int ptr2){ int temp; temp = ptri; ptr1 = ptr2; ptr2 = temp; portion void swap2(int *&ptri, int *&ptr2){ int* temp; temp = ptr1; ptr1 = ptr2; ptr2 = temp; void swap3(int &ptri, int &ptr2) { int temp; temp = ptr1; ptr1 = ptr2; ptr2 = temp; int main({ int *ptr1 = new int[5]; int *ptr2 = new int[5]; for (int i = 0; i A[i+1]) { // swap here if A[i] > A[i+1] temp = A[i]; A[i] = A[i+1]; A[i + 1] = temp; Select one: At most n swaps need to be done in the whole process; After iterating the first outer loop, the largest number can always be fixed; At least one swap needs to be done in the whole process; If there are duplicates in some array, Bubble sort cannot work on it; 600 vu WNP #include int* foo(int x){ int z = x*x; std::cout

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!