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

1. Given an array of values which initially contains 9 8 7 6 5 4 3 2 1, what doe

ID: 667393 • Letter: 1

Question

1. Given an array of values which initially contains 9 8 7 6 5 4 3 2 1, what does the array look like after insertion sort has executed 3 passes, which means that the first 4 values of the array have been put into sorted order.

2. Given an array of values which initially contains 9 8 7 6 5 4 3 2 1, what does the array look like after bubble sort has executed 3 passes, which means that the largest 3 values have been moved to their correct positions in the array.

3. In SQL, The command to join the EMP_LNAME and EMP_FNAME attributes from the EMPLOYEE table and the JOB_NAME attribute from the JOB table where the value of JOB_CODE match is ____.

Explanation / Answer

1) Insertion Sort

Given array = 9 8 7 6 5 4 3 2 1

After 1st pass:

Array is = 8 9 7 6 5 4 3 2 1

After 2nd pass:

Array is = 7 8 9 6 5 4 3 2 1

After 3rd pass:

Array is = 6 7 8 9 5 4 3 2 1

2) Bubble sort

Given initial array = 9 8 7 6 5 4 3 2 1

After pass1:

Array is = 8 7 6 5 4 3 2 1 9

After pass2:

Array is = 7 6 5 4 3 2 1 8 9

After pass3:

Array is = 6 5 4 3 2 1 7 8 9

C)

select (EMPLOYEE .EMP_LNAME || '' || EMPLOYEE .EMP_FNAME || '' ||JOB.JOB_NAME ) from EMPLOYEE, JOB where JOB.JOB_CODE = EMPLOYEE.JOB_CODE;