Question: Please read 10 numbers that are list below, sort the numbers and then print those numbers. 10 numbers = { 9, 3, 2, 1, 10,

Please read 10 numbers that are list below, sort the numbers and then print those numbers.

10 numbers = { 9, 3, 2, 1, 10, 30, 4, 6, 7, 8}

[Reference JavaScript code]

prompt()

[Insertion Sort in pseudocode]

i 1

while i < 10

j i

while j > 0 and num[j-1] > num[j]

swap A[j] and A[j-1]

j j - 1

end while

i i + 1

end while

[JavaScript code]

[output]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!