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 (a_1, a_2, a ... _3, a_h-2, a h-1, a_h) and we have found that our next element from the unordered array, X, is less than a_h. We must change the position of a_h from a_h to a_h + 1 before moving along to compare X with a_h-1. If we then find X, greater than or equal to a_h-1, then we can give X position a_h in the ordered array.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Don't use ai to answer I will report your answer ... Solve it Asap with explanation
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 (a_1, a_2, a
...
_3, a_h-2, a h-1, a_h) and we have found that our next element from the unordered
array, X, is less than a_h. We must change the position of a_h from a_h to a_h + 1 before
moving along to compare X with a_h-1. If we then find X, greater than or equal to a_h-1,
then we can give X position a_h in the ordered array.
Transcribed Image Text: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 (a_1, a_2, a ... _3, a_h-2, a h-1, a_h) and we have found that our next element from the unordered array, X, is less than a_h. We must change the position of a_h from a_h to a_h + 1 before moving along to compare X with a_h-1. If we then find X, greater than or equal to a_h-1, then we can give X position a_h in the ordered array.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education