I'm supposed to create a c++ program which is supposed to take asentence as an input and then output a sorted list of theoccurrence of each letter.
ex.
Enter a phrase: It's a hard knock life
A2
I2
K2
C1
D1
E1
F1
H1
L1
N1
O1
R1
S1
T1
I was also given a recommended code to use as a bubble sort
procedure bubbleSort( A : list ofsortable items )
n = length(A)
repeat
swapped = false
for i = 1 to n-1 inclusive do
/* if this pair is out of order */ ifA[i-1] > A[i] then
/* swap them and remember somethingchanged */ swap( A[i-1], A[i] )
swapped = true
end if end for
until not swapped
end procedure