Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

b. They allow generic development of classes. c. The compil d. They cannot be us

ID: 3914694 • Letter: B

Question

b. They allow generic development of classes. c. The compil d. They cannot be used with polymorphism. er generates a separate class for each type used in the driver. 16. Which statement about static class members is false: a. They have class scope b. They cannot exist until a member of the class exists e. They are initialized exactly once. d. They can be used to track class information such as number of instances. 17. The worst average case run time of the following sorting algorithms is: a. Quick sort c. Selection sort b. Merge sort d. Slow sort 18. The worst at space utilization of the following sorting algorithms is: a. Insertion sort c. Selection sort b. Merge sort d. Bubble sort 19. For very small arrays (n

Explanation / Answer

Solution1:

Use the following information for question 20-22.

20. What is the contents of the array after first iteration of selection sorting?

Exaplanation:

arr[] = {60,50,20,30,40};

In Selection Sorting

Iteration 1

arr[] = {20,50,60,30,40}

Hence, The correct answer is C. {20,50,60,30,40}

21. What is the contents of the array after first iteration of Insertion sorting?

Exaplanation:

arr[] = {60,50,20,30,40};

In Insertion Sorting

We are comapare first two element in array and exachange the place

after First iteration array will become

arr[] = {20,50,60,30,40};

Hence, The correct answer is C.

21. What is the contents of the array after first iteration of bubble sorting?

Exaplanation:

arr[] = {60,50,20,30,40};

In Bubble Sorting

first Iteration is below:

{60,50,20,30,40};

{50,60,20,30,40};

{50,20,60,30,40};

{50,20,30,60,40};

{50,20,30,40,60};

First Iteration is completed

arr[] = {50,20,30,40,60};

Hence, The correct answer is A.

60 50 20 30 40