Run through the following sorting algorithm and determine the largest number.
Run through the following sorting algorithm and determine the largest number.
Assume at the start of this sequence the variables are set as follows:
- List_Size = 5
- Num-1 = 12
- Num-2 = 8
- Num-3 = 5
- Num-4 = 16
- Num-5 = 1
STEP 1 Set Largest# to Num-1
STEP 2 If Largest# < Num-2
Need assignment help for this question?
If you need assistance with writing your essay, we are ready to help you!
OUR PROCESS
Order
Payment
Writing
Delivery
Why Choose Us: Cost-efficiency, Plagiarism free, Money Back Guarantee, On-time Delivery, Total Сonfidentiality, 24/7 Support, 100% originality
Then Set Largest# to Num-2 and Go To Step 3 Largest# after Step 2 = Term 1
Else Go To Step 3
STEP 3 If Largest# < Num-3
Then Set Largest# to Num-3 and Go To Step 4 Largest# after Step 3 = Term 2
Else Go To Step 4
STEP 4 If Largest# < Num-4
Then Set Largest# to Num-4 and Go To Step 5 Largest# after Step 4 = Term 3
Else Go To Step 5
STEP 5 If Largest# < Num-5
Then Set Largest# to Num-5 and Go To Step 6 Largest# after Step 5 = Term 4
Else Go To Step 6
STEP 6 Print “The largest number is” Largest#
STEP 7 Stop Program