Step through the following algorithm and record what the output is (i.e. what would be
displayed on the screen by the print step)
set a to 6,12,1,2,10,0
set size to 6
set k to 0
set h to 0
while k<size-1 do
set j to k+1
while j<size do
if a[j] < a[k] then
set h to a[k]
set a[k] to a[j]
set a[j] to h
set j to j+1
print a[0], a[1], a[2], a[3], a[4], a[5]
set k to k+1
end
Copyright © 2024 1QUIZZ.COM - All rights reserved.
Answers & Comments
Take hep from code.google.com
SK