insert shift array : insert integer to middle of array
Write a function called insertShiftArray which takes in an array and the value to be added. Without utilizing any of the built-in methods available to your language, return an array with the new value added at the middle index.
split the array in half by length by using len() if it is even continue if it is odd add 0.5 to give middle place. rebuilt array one by one in for loop, if the index is less than the previously decided middle value, append to the empty array. if the value is equal to the middle value append the middle value then the new integer. if the index is greater than the middle value, append.
Insert and shift an array in middle at index
Write a function called insertShiftArray which takes in an array and the value to be added. Without utilizing any of the built-in methods available to your language, return an array with the new value added at the middle index.
Example
[2,4,6,8], 5 [2,4,5,6,8]
[4,8,15,23,42], 16 [4,8,15,16,23,42]
Stretch Goal Once you’ve achieved a working solution, write a second function that removes an element from the middle index and shifts other elements in the array to fill the new gap.
Requirements Ensure your complete solution follows the standard requirements.
Write unit tests Follow the template for a well-formatted README Submit the assignment following these instructions
