figure simple sorting the insertsort workshop applet with bars at the beginninginner and outer point to the second bar from the left (array index )and the first message is will copy outer to temp this will make room for the shift (there' no arrow for inner- but of course it' always one bar to the left of inner click the step button the bar at outer will be copied to temp we say that items are copied from source to destination when performing copythe applet removes the bar from the source locationleaving blank this is slightly misleading because in real java program the reference in the source would remain there howeverblanking the source makes it easier to see what' happening what happens next depends on whether the first two bars are already in order (smaller on the leftif they areyou'll see the message have compared inner- and tempno copy necessary if the first two bars are not in orderthe message is have compared inner- and tempwill copy inner- to inner this is the shift that' necessary to make room for the value in temp to be reinserted there' only one such shift on this first passmore shifts will be necessary on subsequent passes the situation is shown in figure on the next clickyou'll see the copy take place from inner- to inner alsothe inner arrow moves one space left the new message is now inner is so no copy necessary the shifting process is complete no matter which of the first two bars was shorterthe next click will show you will copy temp to inner this will happenbut if the first two bars were initially in orderyou won' be able to tell copy was performed because temp and inner hold the same bar copying data over the top of the same data may seem inefficientbut the algorithm runs faster if it doesn' check for this possibilitywhich happens comparatively infrequently