Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given a one - dimensional array of integers, write an Excel user - defined function that will accept the parameter of a one - dimensional

Given a one-dimensional array of integers, write an Excel user-defined function that will accept the parameter of a one-dimensional array of integers and return a one-dimensional 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 (a1, a2, a3,..., ah-2, ah-1, 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 +1 before moving along to compare X with ah-1. If we then find X, greater than or equal to ah-1, then we can give X position ah in the ordered array.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions