 1). Sort the list E, X, A, M, P, L, E in alphabetical order by sele... Question

1). Sort the list E, X, A, M, P, L, E in alphabetical order by selection sort. Trace the execution steps also besides providing the pseudo code.

2). Sort the list E, X, A, M, P, L, E in alphabetical order by bubble sort. Trace the execution steps also besides providing the pseudo code.

Note: include the actual list elements in the execution of the algorithms. Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

We can consider our array to sort by Selection Sort being A[0..6] where A=E, A=X,…A=E.
The above pseudocode can be equivalently rewritten as:
For i=0 to 7-2=5 do Min=i
For j=i+1 to 7-1=6 do
If A(j) < A(min) min=j
Swap A(i) with A(min)

Step1)
i=0=> min=0
for j=1 to 6 do if A(j)< A(min) min=j
swap A(0) with A(min)
j=1=> if A(1) <A(0) => X <E nothing
j=2=> if A(2) <A(0)=> A<E => min=2
j=3=> if A(3)<A(2)=> M < A nothing
j=4=> if A(4) < A(2)=> P < A nothing
j=5=> if A(5) < A(2) => L < A nothing
j=6=> If A(6) <A(2)=> E < A nothing
swap (A(0), A(2))= > swap (E, A)=A, E => the array is A X E M P L E

Step2)...

By purchasing this solution you'll be able to access the following files:
Solution.docx.

50% discount

Hours
Minutes
Seconds
\$13.00 \$6.50
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Data Structures and Algorithms Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.