1 write a program where you enter a sequence of famous computer scientists last name 5347004

1. Write a program where you enter a sequence of famous computer scientists’ last names, see the link


to a vector called Turing_winners. Terminate input by the line “No more”. Your program must be able

to display Turing awards winners in alphabetical or lexicographical order using first the STL algorithm sort (see

an example in the textbook on p.121), and then selection sort algorithm you will write in C++. The description

(in pseudo code – it is not C++ code) of the sort algorithm is below:

// algorithm selectionSort( A : list of sortable items )

n = length(A)

for (k = 0; k

index = k;

for (i = k+1; i

if A[i]

index = i

end if

end for

// swap two elements A[k] and A[index]

end for

// end algorithm

(a) Analyze the algorithm step by step using an input sequence of integer numbers 10, 9, 8, 7, 6 as a vector A.

The expected output should be 6, 7, 8, 9, 10. You can read more about the sorting process


(b) Write a C++ code for the algorithm above that handle the sequence of the Turing awards winners as a

vector A.

(c) Run both the sorting programs using three types of inputs:

i. names are already sorted in the alphabetical order

ii. names are given in a random order

iii. names are given in reverse order.

"Get 15% discount on your first 3 orders with us"
Use the following coupon

Order Now