Question
3. Create a function named insertIntoSortedArray that takes the array, number of entries currently in the array, and new value to be inserted as parameters.
3. Create a function named insertIntoSortedArray that takes the array, number of entries currently in the array, and new value to be inserted as parameters. Inside the function insert the new value into the correct position in the sorted array. Return the new number of entries in the list. Use the following signature: int insertIntoSortedArray(int myArray[ ], int numEntries, int newValue) 4. Print out the entire array each time after calling insertIntoSortedArray, displaying the values as a comma separated list. 5. Print out the total number of entries in the array after reading in the file For example, Given a data file named dat.txt with the following values: 9 3 6
The output would be: dat.txt 9 3,9 3,6,9 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started