Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If you sort an array, you must physically move/swap the data from its original location to other location. Small arrays not a real problem, the

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
If you sort an array, you must physically "move/swap" the data from its original location to other location. Small arrays not a real problem, the larger the number of items, the more I/O verhead involved. What if we need to keep that array in its original order? Creating duplicate arrays is not a solution. How about using memory pointers? What if we use a "shadow array of pointers to each index location in the original array"? The pointer addresses are swapped instead of the actual data values. Load an integer array (called it "mumbers") of size 15 with random integer values ranging from 1 to 100 Create two additional arrays of pointers, aim the array index pointers to the integer array Pass the first array of pointers to a sort function to "sort ascending order the pointer values based on the value that these pointers are "pointing" to in the "numbers" array. The pointer values will be swapped within the pointer array Pass the second array of pointers to a function to sort descending order" the pointer values based on the value that these pointers are "pointing to in the numbers" array The pointer values will be swapped within the pointer array Display the contents of the numbers array Display the numeric values that the ascending pointer array and the descending pointer array are pointing" at in the numbers array You will need to code an ascending and descending sort (simplest is a "bubble") Default

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

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions

Question

What are HR ethics?

Answered: 1 week ago

Question

=+2 Why are international employment standards important to IHRM?

Answered: 1 week ago