Sorting of an Array called arr
////////////////////////'//
-
Declare a function to run the insertion algorithm with the array called arr
-
set variables where currentElement is arr(index)
-
while a variable of j would be equal to the immediate left index after i
-
Run a for loop through the array to loop through each of tehn index starting from index 1 which would be the second element in teh array, in every iteration compare the index with the immedate left index (j) to find out if j is greater than i
-
Run a while loop that checks if arr(j) is greater than currentElement, then it would it add + 1 to the integer of arr(j) if not irt would skip and go to the next index of currentElement
-
Call the fuction that sorts out an array in an algorithm
-
Write out the sorted value of array back to user