InsertionSortMethod(a,n)

Here a is an linear array with n elements in array with n elements in the ascending order. It uses a temporary variable temp to facilitate the exchange of two values and variable j and k are used as loop control and index variables.



Begin
for k=1 to (n-1) by 1 do
Set temp = a[k]
Set j=k-1
while ((temp=0))do
Set a[j+1] = a[j]
Set j=j-1
endwhile
Set a[j+1] = temp
endfor
End


--------------------------------------------------------


Human do error, please email:- webmaster@piyadas-world.com if you find any. Please visit http://www.piyadas-world.com for more resource.

0 comments