Question: Given a one - dimensional array of integers, write an Excel user - defined function that will accept the parameter of a one - dimensional
Given a onedimensional array of integers, write an Excel userdefined function that will accept the parameter of a onedimensional array of integers and return a onedimensional array of the same integers in order from least to greatest using the Insertion Algorithm.
The main procedural trick will be as we compare our next element from the unordered array with, from right to left, the elements of the newly ordered array and find our next element is less than the one being compared, we must shift the position of the compared element to the right one position in the array. That is suppose the ordered array has elements a a a ah ah ah and we have found that our next element from the unordered array, X is less than ah We must change the position of ah from ah to ah before moving along to compare X with ah If we then find X greater than or equal to ah then we can give X position ah in the ordered array.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
