write a algorithm and draw the flowchart of sort array elements in asending order
Answers
Answered by
3
Answer:
algorithm Bubble_Sort(list)
Start
Pre: list != fi
Post: list is sorted in ascending order for all values
for i <- 0 to list:Count - 1
for j <- 0 to list:Count - 1
if list[i] < list[j] then
Swap(list[i]; list[j])
end if
end for
end for
return list
end Bubble_Sort
Stop
Similar questions