Answer:
Sorted array:-
3 5 5 9
Explanation:
Insertion sort algorithms really similar to the sorting a deck of cards.
Pick an element and insert it to the place where it belongs.
Steps are as following:-
1st Iteration:-
element picked 5
nothing is done.
array = 5 3 9 5
2nd iteration:-
element picked 3
Right shift all the elements and insert it at the first position.
array=3 5 9 5
3rd iteration:-
element picked 9
nothing is done.
array= 3 5 9 5.
4th iteration:-
element picked 5
right shift all the element from 9 insert it at the position where 9 was
array = 3 5 5 9
Now the array is sorted.