(Solved) : Hi Really Stuck Problem Posting Work Done Far 4 Suppose Series 10 Storage Locations Named Q44020628 . . .
Hi, I am really stuck on this problem. I am posting it belowwith the work I have done so far.
“4. Suppose you have a series of 10 storage locations named S[1] ,S[2], etc. thru S[10]. Using a while loop, an index variable K, and1 temporary storage location named T, write an algorithm that willreverse the order of values in the storage locations so that S[1]holds the value formerly in S[10], S[2] holds the value formerly inS[9], etc., and S[10] holds the value formerly in S[1]. Use theindex variable or an expression inside the square brackets of S[ ]to indicate which storage location is being accessed.”
Get values
n=10, list items= S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[8],S[9], S[10]
T= temporary storage location
Set index variable to 0
k=0
While k5do steps 4-6
Select largest number in the unsorted section of the list and storein temporary storage location, T
Exchange with the last number in the unsorted section
Add 1 to index variable
k= k + 1
Stop
Expert Answer
Answer to Hi, I am really stuck on this problem. I am posting it below with the work I have done so far. “4. Suppose you have a se…
OR