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

Using this as an example:

//Sorts a given array by selection sort

//Input: An array A[0..n − 1] of orderable elements

//Output: Array A[0..n − 1] sorted in non-decreasing order

for i ←0 to n − 2 do

min←i

for j ←i + 1 to n − 1 do

if A[j ]<A[min] min←j

swap A[i] and A[min]

2) Sort the list E, X, A, M, P, L, E in alphabetical order by bubble sort.

Using this as an example:

//Sorts a given array by bubble sort

//Input: An array A[0..n − 1] of orderable elements

//Output: Array A[0..n − 1] sorted in non-decreasing order

for i ←0 to n − 2 do

for j ←0 to n − 2 − i do

if A[j + 1]<A[j ] swap A[j ] and A[j + 1]

**Subject Computer Science Data Structures and Algorithms**